5.1.18-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 1/138 crypto: talitos - fix hash on SEC1.
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 58cdbc6d2263beb36954408522762bbe73169306 upstream.
On SEC1, hash provides wrong result when performing hashing in several steps with input data SG list has more than one element. This was detected with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS:
[ 44.185947] alg: hash: md5-talitos test failed (wrong result) on test vector 6, cfg="random: may_sleep use_finup src_divs=[<reimport>25.88%@+8063, <flush>24.19%@+9588, 28.63%@+16333, <reimport>4.60%@+6756, 16.70%@+16281] dst_divs=[71.61%@alignmask+16361, 14.36%@+7756, 14.3%@+" [ 44.325122] alg: hash: sha1-talitos test failed (wrong result) on test vector 3, cfg="random: inplace use_final src_divs=[<flush,nosimd>16.56%@+16378, <reimport>52.0%@+16329, 21.42%@alignmask+16380, 10.2%@alignmask+16380] iv_offset=39" [ 44.493500] alg: hash: sha224-talitos test failed (wrong result) on test vector 4, cfg="random: use_final nosimd src_divs=[<reimport>52.27%@+7401, <reimport>17.34%@+16285, <flush>17.71%@+26, 12.68%@+10644] iv_offset=43" [ 44.673262] alg: hash: sha256-talitos test failed (wrong result) on test vector 4, cfg="random: may_sleep use_finup src_divs=[<reimport>60.6%@+12790, 17.86%@+1329, <reimport>12.64%@alignmask+16300, 8.29%@+15, 0.40%@+13506, <reimport>0.51%@+16322, <reimport>0.24%@+16339] dst_divs"
This is due to two issues:
- We have an overlap between the buffer used for copying the input data (SEC1 doesn't do scatter/gather) and the chained descriptor.
- Data copy is wrong when the previous hash left less than one blocksize of data to hash, implying a complement of the previous block with a few bytes from the new request.
Fix it by:
- Moving the second descriptor after the buffer, as moving the buffer after the descriptor would make it more complex for other cipher operations (AEAD, ABLKCIPHER)
- Skip the bytes taken from the new request to complete the previous one by moving the SG list forward.
--- drivers/crypto/talitos.c | 69 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 28 deletions(-)
drivers/crypto/talitos.c +41 -28
@@ -334,6 +334,21 @@ int talitos_submit(struct device *dev, i }EXPORT_SYMBOL (talitos_submit); +static __be32 get_request_hdr (struct talitos_request *request,bool is_sec1) +{ +struct talitos_edesc *edesc; + +if (!is_sec1) +return request->desc->hdr; + +if (!request->desc->next_desc) +return request->desc->hdr1; + + edesc = container_of(request->desc, struct talitos_edesc, desc); + +return ((struct talitos_desc *)(edesc->buf + edesc->dma_len))->hdr1; +} +/* * process what was done, notify callback of error if not */
@@ -355,12 +370,7 @@ static void flush_channel(struct device/* descriptors with their done bits set don't get the error */ rmb (); -if (!is_sec1) - hdr = request->desc->hdr; -else if (request->desc->next_desc) - hdr = (request->desc +1 )->hdr1; -else - hdr = request->desc->hdr1; + hdr =get_request_hdr (request, is_sec1);if ((hdr &DESC_HDR_DONE ) ==DESC_HDR_DONE ) status =0 ;
@@ -490,8 +500,14 @@ static u32 current_desc_hdr(struct devic } } -if (priv->chan[ch].fifo[iter].desc->next_desc == cur_desc) -return (priv->chan[ch].fifo[iter].desc +1 )->hdr; +if (priv->chan[ch].fifo[iter].desc->next_desc == cur_desc) { +struct talitos_edesc *edesc; + + edesc =container_of (priv->chan[ch].fifo[iter].desc, + struct talitos_edesc, desc); +return ((struct talitos_desc *) + (edesc->buf + edesc->dma_len))->hdr; + }return priv->chan[ch].fifo[iter].desc->hdr; }
@@ -1431,15 +1447,11 @@ static struct talitos_edesc *talitos_ede edesc->dst_nents = dst_nents; edesc->iv_dma = iv_dma; edesc->dma_len = dma_len; -if (dma_len) { -void *addr = &edesc->link_tbl[0 ]; - -if (is_sec1 && !dst) - addr +=sizeof (struct talitos_desc ); - edesc->dma_link_tbl =dma_map_single (dev, addr, +if (dma_len) + edesc->dma_link_tbl =dma_map_single (dev, &edesc->link_tbl[0 ], edesc->dma_len,DMA_BIDIRECTIONAL ); - } +return edesc; }
@@ -1706,14 +1718,16 @@ static void common_nonsnoop_hash_unmap(sstruct talitos_private *priv =dev_get_drvdata (dev);bool is_sec1 =has_ftr_sec1 (priv);struct talitos_desc *desc = &edesc->desc; -struct talitos_desc *desc2 = desc +1 ; +struct talitos_desc *desc2 = (struct talitos_desc *) + (edesc->buf + edesc->dma_len);unmap_single_talitos_ptr (dev, &edesc->desc.ptr[5 ],DMA_FROM_DEVICE );if (desc->next_desc && desc->ptr[5 ].ptr != desc2->ptr[5 ].ptr)unmap_single_talitos_ptr (dev, &desc2->ptr[5 ],DMA_FROM_DEVICE ); -talitos_sg_unmap (dev, edesc, req_ctx->psrc,NULL ,0 ,0 ); +if (req_ctx->psrc) +talitos_sg_unmap (dev, edesc, req_ctx->psrc,NULL ,0 ,0 );/* When using hashctx-in, must unmap it. */ if (from_talitos_ptr_len (&edesc->desc.ptr[1 ], is_sec1))
@@ -1780,7 +1794,6 @@ static void talitos_handle_buggy_hash(ststatic int common_nonsnoop_hash (struct talitos_edesc *edesc,struct ahash_request *areq,unsigned int length, -unsigned int offset,void (*callback) (struct device *dev,struct talitos_desc *desc,void *context,int error))
@@ -1819,9 +1832,7 @@ static int common_nonsnoop_hash(struct t sg_count = edesc->src_nents ?:1 ;if (is_sec1 && sg_count >1 ) -sg_pcopy_to_buffer (req_ctx->psrc, sg_count, - edesc->buf +sizeof (struct talitos_desc ), - length, req_ctx->nbuf); +sg_copy_to_buffer (req_ctx->psrc, sg_count, edesc->buf, length);else if (length) sg_count =dma_map_sg (dev, req_ctx->psrc, sg_count,DMA_TO_DEVICE );
@@ -1834,7 +1845,7 @@ static int common_nonsnoop_hash(struct t DMA_TO_DEVICE); }else { sg_count =talitos_sg_map (dev, req_ctx->psrc, length, edesc, - &desc->ptr[3 ], sg_count, offset,0 ); + &desc->ptr[3 ], sg_count,0 ,0 );if (sg_count >1 ) sync_needed = true; }
@@ -1858,7 +1869,8 @@ static int common_nonsnoop_hash(struct ttalitos_handle_buggy_hash (ctx, edesc, &desc->ptr[3 ]);if (is_sec1 && req_ctx->nbuf && length) { -struct talitos_desc *desc2 = desc +1 ; +struct talitos_desc *desc2 = (struct talitos_desc *) + (edesc->buf + edesc->dma_len);dma_addr_t next_desc;memset (desc2,0 ,sizeof (*desc2));
@@ -1879,7 +1891,7 @@ static int common_nonsnoop_hash(struct t DMA_TO_DEVICE);copy_talitos_ptr (&desc2->ptr[2 ], &desc->ptr[2 ], is_sec1); sg_count =talitos_sg_map (dev, req_ctx->psrc, length, edesc, - &desc2->ptr[3 ], sg_count, offset,0 ); + &desc2->ptr[3 ], sg_count,0 ,0 );if (sg_count >1 ) sync_needed = true;copy_talitos_ptr (&desc2->ptr[5 ], &desc->ptr[5 ], is_sec1);
@@ -1990,7 +2002,6 @@ static int ahash_process_req(struct ahasstruct device *dev = ctx->dev;struct talitos_private *priv =dev_get_drvdata (dev);bool is_sec1 =has_ftr_sec1 (priv); -int offset =0 ;u8 *ctx_buf = req_ctx->buf[req_ctx->buf_idx];if (!req_ctx->last && (nbytes + req_ctx->nbuf <= blocksize)) {
@@ -2030,6 +2041,8 @@ static int ahash_process_req(struct ahassg_chain (req_ctx->bufsl,2 , areq->src); req_ctx->psrc = req_ctx->bufsl; }else if (is_sec1 && req_ctx->nbuf && req_ctx->nbuf < blocksize) { +int offset; +if (nbytes_to_hash > blocksize) offset = blocksize - req_ctx->nbuf;else
@@ -2042,7 +2055,8 @@ static int ahash_process_req(struct ahassg_copy_to_buffer (areq->src, nents, ctx_buf + req_ctx->nbuf, offset); req_ctx->nbuf += offset; - req_ctx->psrc = areq->src; + req_ctx->psrc =scatterwalk_ffwd (req_ctx->bufsl, areq->src, + offset); }else req_ctx->psrc = areq->src;
@@ -2082,8 +2096,7 @@ static int ahash_process_req(struct ahasif (ctx->keylen && (req_ctx->first || req_ctx->last)) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_HMAC ; -return common_nonsnoop_hash (edesc, areq, nbytes_to_hash, offset, - ahash_done); +return common_nonsnoop_hash (edesc, areq, nbytes_to_hash, ahash_done); }static int ahash_update (struct ahash_request *areq)
Greg Kroah-Hartman
maintainerPATCH 10/138 Input: elantech - enable middle button support on 2 ThinkPads
In reply to Greg Kroah-Hartman[ Upstream commit aa440de3058a3ef530851f9ef373fbb5f694dbc3 ]
Adding 2 new touchpad PNPIDs to enable middle button support.
--- drivers/input/mouse/elantech.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/mouse/elantech.c +2 -0
@@ -1189,6 +1189,8 @@ static const char * const middle_button_pnp_ids[] = {"LEN2132" ,/* ThinkPad P52 */ "LEN2133" ,/* ThinkPad P72 w/ NFC */ "LEN2134" ,/* ThinkPad P72 */ +"LEN0407" , +"LEN0408" , NULL };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 11/138 samples, bpf: fix to change the buffer size for read()
In reply to Greg Kroah-Hartman[ Upstream commit f7c2d64bac1be2ff32f8e4f500c6e5429c1003e0 ]
If the trace for read is larger than 4096, the return value sz will be 4096. This results in off-by-one error on buf:
static char buf[4096];
ssize_t sz;
sz = read(trace_fd, buf, sizeof(buf));
if (sz > 0) {
buf[sz] = 0;
puts(buf);
}--- samples/bpf/bpf_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/bpf_load.c +1 -1
@@ -678,7 +678,7 @@ void read_trace_pipe(void)static char buf[4096 ];ssize_t sz; - sz =read (trace_fd, buf,sizeof (buf)); + sz =read (trace_fd, buf,sizeof (buf) -1 );if (sz >0 ) { buf[sz] =0 ;puts (buf);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 12/138 samples, bpf: suppress compiler warning
In reply to Greg Kroah-Hartman[ Upstream commit a195cefff49f60054998333e81ee95170ce8bf92 ]
GCC 9 fails to calculate the size of local constant strings and produces a false positive:
samples/bpf/task_fd_query_user.c: In function ‘test_debug_fs_uprobe’:samples/bpf/task_fd_query_user.c:242:67: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 215 [-Wformat-truncation=]
242 | snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
| ^~
243 | event_type, event_alias);
| ~~~~~~~~~~~
samples/bpf/task_fd_query_user.c:242:2: note: ‘snprintf’ output between 45 and 300 bytes into a destination of size 256
242 | snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
243 | event_type, event_alias);
| ~~~~~~~~~~~~~~~~~~~~~~~~Workaround this by lowering the buffer size to a reasonable value. Related GCC Bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83431
--- samples/bpf/task_fd_query_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/task_fd_query_user.c +1 -1
@@ -216,7 +216,7 @@ static int test_debug_fs_uprobe(char *binary_path, long offset, bool is_return) {const char *event_type ="uprobe" ;struct perf_event_attr attr = {}; -char buf[256 ], event_alias[256 ]; +char buf[256 ], event_alias[sizeof ("test_1234567890" )];__u64 probe_offset, probe_addr;__u32 len, prog_id, fd_type;int err, res, kfd, efd;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 13/138 bpf, riscv: clear target register high 32-bits for and/or/xor on ALU32
In reply to Greg Kroah-Hartman[ Upstream commit fe121ee531d1362810bfd30f38a1b88b1d3d376c ]
When using 32-bit subregisters (ALU32), the RISC-V JIT would not clear the high 32-bits of the target register and therefore generate incorrect code.
E.g., in the following code:
$ cat test.c
unsigned int f(unsigned long long a,
unsigned int b)
{
return (unsigned int)a & b;
}$ clang-9 -target bpf -O2 -emit-llvm -S test.c -o - | \ llc-9 -mattr=+alu32 -mcpu=v3 .text .file "test.c" .globl f .p2align 3 .type f,@function f: r0 = r1 w0 &= w2 exit .Lfunc_end0: .size f, .Lfunc_end0-f
The JIT would not clear the high 32-bits of r0 after the and-operation, which in this case might give an incorrect return value.
After this patch, that is not the case, and the upper 32-bits are cleared.
--- arch/riscv/net/bpf_jit_comp.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/riscv/net/bpf_jit_comp.c +6 -0
@@ -759,14 +759,20 @@ static int emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,case BPF_ALU |BPF_AND |BPF_X :case BPF_ALU64 |BPF_AND |BPF_X :emit (rv_and (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_OR |BPF_X :case BPF_ALU64 |BPF_OR |BPF_X :emit (rv_or (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_XOR |BPF_X :case BPF_ALU64 |BPF_XOR |BPF_X :emit (rv_xor (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_MUL |BPF_X :case BPF_ALU64 |BPF_MUL |BPF_X :
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 14/138 bpf: sockmap, restore sk_write_space when psock gets dropped
In reply to Greg Kroah-Hartman[ Upstream commit 186bcc3dcd106dc52d706117f912054b616666e1 ]
Once psock gets unlinked from its sock (sk_psock_drop), user-space can still trigger a call to sk->sk_write_space by setting TCP_NOTSENT_LOWAT socket option. This causes a null-ptr-deref because we try to read psock->saved_write_space from sk_psock_write_space:
==================================================================
BUG: KASAN: null-ptr-deref in sk_psock_write_space+0x69/0x80 Read of size 8 at addr 00000000000001a0 by task sockmap-echo/131 CPU: 0 PID: 131 Comm: sockmap-echo Not tainted 5.2.0-rc1-00094-gf49aa1de9836 #81 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20180724_192412-buildhw-07.phx2.fedoraproject.org-1.fc29 04/01/2014 Call Trace: ? sk_psock_write_space+0x69/0x80 __kasan_report.cold.2+0x5/0x3f ? sk_psock_write_space+0x69/0x80 kasan_report+0xe/0x20 sk_psock_write_space+0x69/0x80 tcp_setsockopt+0x69a/0xfc0 ? tcp_shutdown+0x70/0x70 ? fsnotify+0x5b0/0x5f0 ? remove_wait_queue+0x90/0x90 ? __fget_light+0xa5/0xf0 __sys_setsockopt+0xe6/0x180 ? sockfd_lookup_light+0xb0/0xb0 ? vfs_write+0x195/0x210 ? ksys_write+0xc9/0x150 ? __x64_sys_read+0x50/0x50 ? __bpf_trace_x86_fpu+0x10/0x10 __x64_sys_setsockopt+0x61/0x70 do_syscall_64+0xc5/0x520 ? vmacache_find+0xc0/0x110 ? syscall_return_slowpath+0x110/0x110 ? handle_mm_fault+0xb4/0x110 ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe ? trace_hardirqs_off_caller+0x4b/0x120 ? trace_hardirqs_off_thunk+0x1a/0x3a entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f2e5e7cdcce Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b1 66 2e 0f 1f 84 00 00 00 00 00
0f 1f 44 00 00 f3 0f 1e fa 49 89 ca b8 36 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8a 11 0c 00 f7 d8 64 89 01 48
RSP: 002b:00007ffed011b778 EFLAGS: 00000206 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f2e5e7cdcce
RDX: 0000000000000019 RSI: 0000000000000006 RDI: 0000000000000007
RBP: 00007ffed011b790 R08: 0000000000000004 R09: 00007f2e5e84ee80
R10: 00007ffed011b788 R11: 0000000000000206 R12: 00007ffed011b78c
R13: 00007ffed011b788 R14: 0000000000000007 R15: 0000000000000068
==================================================================
Restore the saved sk_write_space callback when psock is being dropped to fix the crash.
--- include/linux/skmsg.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/skmsg.h +2 -0
@@ -351,6 +351,8 @@ static inline void sk_psock_update_proto(struct sock *sk,static inline void sk_psock_restore_proto (struct sock *sk,struct sk_psock *psock) { + sk->sk_write_space = psock->saved_write_space; +if (psock->sk_proto) { sk->sk_prot = psock->sk_proto; psock->sk_proto =NULL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 16/138 bpf: sockmap, fix use after free from sleep in psock backlog workqueue
In reply to Greg Kroah-Hartman[ Upstream commit bd95e678e0f6e18351ecdc147ca819145db9ed7b ]
Backlog work for psock (sk_psock_backlog) might sleep while waiting for memory to free up when sending packets. However, while sleeping the socket may be closed and removed from the map by the user space side.
This breaks an assumption in sk_stream_wait_memory, which expects the wait queue to be still there when it wakes up resulting in a use-after-free shown below. To fix his mark sendmsg as MSG_DONTWAIT to avoid the sleep altogether. We already set the flag for the sendpage case but we missed the case were sendmsg is used. Sockmap is currently the only user of skb_send_sock_locked() so only the sockmap paths should be impacted.
==================================================================
BUG: KASAN: use-after-free in remove_wait_queue+0x31/0x70 Write of size 8 at addr ffff888069a0c4e8 by task kworker/0:2/110 CPU: 0 PID: 110 Comm: kworker/0:2 Not tainted 5.0.0-rc2-00335-g28f9d1a3d4fe-dirty #14 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014 Workqueue: events sk_psock_backlog Call Trace: print_address_description+0x6e/0x2b0 ? remove_wait_queue+0x31/0x70 kasan_report+0xfd/0x177 ? remove_wait_queue+0x31/0x70 ? remove_wait_queue+0x31/0x70 remove_wait_queue+0x31/0x70 sk_stream_wait_memory+0x4dd/0x5f0 ? sk_stream_wait_close+0x1b0/0x1b0 ? wait_woken+0xc0/0xc0 ? tcp_current_mss+0xc5/0x110 tcp_sendmsg_locked+0x634/0x15d0 ? tcp_set_state+0x2e0/0x2e0 ? __kasan_slab_free+0x1d1/0x230 ? kmem_cache_free+0x70/0x140 ? sk_psock_backlog+0x40c/0x4b0 ? process_one_work+0x40b/0x660 ? worker_thread+0x82/0x680 ? kthread+0x1b9/0x1e0 ? ret_from_fork+0x1f/0x30 ? check_preempt_curr+0xaf/0x130 ? iov_iter_kvec+0x5f/0x70 ? kernel_sendmsg_locked+0xa0/0xe0 skb_send_sock_locked+0x273/0x3c0 ? skb_splice_bits+0x180/0x180 ? start_thread+0xe0/0xe0 ? update_min_vruntime.constprop.27+0x88/0xc0 sk_psock_backlog+0xb3/0x4b0 ? strscpy+0xbf/0x1e0 process_one_work+0x40b/0x660 worker_thread+0x82/0x680 ? process_one_work+0x660/0x660 kthread+0x1b9/0x1e0 ? __kthread_create_on_node+0x250/0x250 ret_from_fork+0x1f/0x30
--- net/core/skbuff.c | 1 + 1 file changed, 1 insertion(+)
net/core/skbuff.c +1 -0
@@ -2309,6 +2309,7 @@ int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset, kv.iov_base = skb->data + offset; kv.iov_len = slen;memset (&msg,0 ,sizeof (msg)); + msg.msg_flags =MSG_DONTWAIT ; ret =kernel_sendmsg_locked (sk, &msg, &kv,1 , slen);if (ret <=0 )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 15/138 mac80211: fix rate reporting inside cfg80211_calculate_bitrate_he()
In reply to Greg Kroah-Hartman[ Upstream commit 25d16d124a5e249e947c0487678b61dcff25cf8b ]
The reported rate is not scaled down correctly. After applying this patch, the function will behave just like the v/ht equivalents.
--- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/util.c +1 -1
@@ -1237,7 +1237,7 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate)if (rate->he_dcm) result /=2 ; -return result; +return result /10000 ; }u32 cfg80211_calculate_bitrate (struct rate_info *rate)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 18/138 staging:iio:ad7150: fix threshold mode config bit
In reply to Greg Kroah-Hartman[ Upstream commit df4d737ee4d7205aaa6275158aeebff87fd14488 ]
According to the AD7150 configuration register description, bit 7 assumes value 1 when the threshold mode is fixed and 0 when it is adaptive, however, the operation that identifies this mode was considering the opposite values.
This patch renames the boolean variable to describe it correctly and properly replaces it in the places where it is used.
--- drivers/staging/iio/cdc/ad7150.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/staging/iio/cdc/ad7150.c +11 -8
@@ -6,6 +6,7 @@* Licensed under the GPL-2 or later. */ +#include <linux/bitfield.h> #include <linux/interrupt.h> #include <linux/device.h> #include <linux/kernel.h>
@@ -131,7 +132,7 @@ static int ad7150_read_event_config(struct iio_dev *indio_dev, {int ret;u8 threshtype; -bool adaptive; +bool thrfixed;struct ad7150_chip_info *chip =iio_priv (indio_dev); ret =i2c_smbus_read_byte_data (chip->client,AD7150_CFG );
@@ -139,21 +140,23 @@ static int ad7150_read_event_config(struct iio_dev *indio_dev,return ret; threshtype = (ret >>5 ) &0x03 ; - adaptive = !!(ret &0x80 ); + +/*check if threshold mode is fixed or adaptive*/ + thrfixed =FIELD_GET (AD7150_CFG_FIX , ret);switch (type) {case IIO_EV_TYPE_MAG_ADAPTIVE :if (dir ==IIO_EV_DIR_RISING ) -return adaptive && (threshtype ==0x1 ); -return adaptive && (threshtype ==0x0 ); +return !thrfixed && (threshtype ==0x1 ); +return !thrfixed && (threshtype ==0x0 );case IIO_EV_TYPE_THRESH_ADAPTIVE :if (dir ==IIO_EV_DIR_RISING ) -return adaptive && (threshtype ==0x3 ); -return adaptive && (threshtype ==0x2 ); +return !thrfixed && (threshtype ==0x3 ); +return !thrfixed && (threshtype ==0x2 );case IIO_EV_TYPE_THRESH :if (dir ==IIO_EV_DIR_RISING ) -return !adaptive && (threshtype ==0x1 ); -return !adaptive && (threshtype ==0x0 ); +return thrfixed && (threshtype ==0x1 ); +return thrfixed && (threshtype ==0x0 );default :break ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 19/138 mac80211: mesh: fix RCU warning
In reply to Greg Kroah-Hartman[ Upstream commit 551842446ed695641a00782cd118cbb064a416a1 ]
ifmsh->csa is an RCU-protected pointer. The writer context in ieee80211_mesh_finish_csa() is already mutually exclusive with wdev->sdata.mtx, but the RCU checker did not know this. Use rcu_dereference_protected() to avoid a warning.
fixes the following warning:
[ 12.519089] =============================
[ 12.520042] WARNING: suspicious RCU usage
[ 12.520652] 5.1.0-rc7-wt+ #16 Tainted: G W
[ 12.521409] -----------------------------
[ 12.521972] net/mac80211/mesh.c:1223 suspicious rcu_dereference_check() usage!
[ 12.522928] other info that might help us debug this:
[ 12.523984] rcu_scheduler_active = 2, debug_locks = 1
[ 12.524855] 5 locks held by kworker/u8:2/152:
[ 12.525438] #0: 00000000057be08c ((wq_completion)phy0){+.+.}, at: process_one_work+0x1a2/0x620
[ 12.526607] #1: 0000000059c6b07a ((work_completion)(&sdata->csa_finalize_work)){+.+.}, at: process_one_work+0x1a2/0x620
[ 12.528001] #2: 00000000f184ba7d (&wdev->mtx){+.+.}, at: ieee80211_csa_finalize_work+0x2f/0x90
[ 12.529116] #3: 00000000831a1f54 (&local->mtx){+.+.}, at: ieee80211_csa_finalize_work+0x47/0x90
[ 12.530233] #4: 00000000fd06f988 (&local->chanctx_mtx){+.+.}, at: ieee80211_csa_finalize_work+0x51/0x90--- net/mac80211/mesh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/mac80211/mesh.c +4 -1
@@ -1220,7 +1220,8 @@ int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata) ifmsh->chsw_ttl =0 ;/* Remove the CSA and MCSP elements from the beacon */ - tmp_csa_settings =rcu_dereference (ifmsh->csa); + tmp_csa_settings =rcu_dereference_protected (ifmsh->csa, +lockdep_is_held (&sdata->wdev.mtx));RCU_INIT_POINTER (ifmsh->csa,NULL );if (tmp_csa_settings)kfree_rcu (tmp_csa_settings, rcu_head);
@@ -1242,6 +1243,8 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,struct mesh_csa_settings *tmp_csa_settings;int ret =0 ; +lockdep_assert_held (&sdata->wdev.mtx); + tmp_csa_settings =kmalloc (sizeof (*tmp_csa_settings),GFP_ATOMIC );if (!tmp_csa_settings)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 21/138 ARM: dts: Drop bogus CLKSEL for timer12 on dra7
In reply to Greg Kroah-Hartman[ Upstream commit 34f61de87017aff3c8306280d196dddb1e168a88 ]
There is no CLKSEL for timer12 on dra7 unlike for timer1. This causes issues on booting the device that Tomi noticed if DEBUG_SLAB is enabled and the clkctrl clock does not properly handle non-existing clock. Let's drop the bogus CLKSEL clock, the clkctrl clock handling gets fixed separately.
--- arch/arm/boot/dts/dra7-l4.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/dra7-l4.dtsi +0 -2
@@ -4450,8 +4450,6 @@ timer12: timer@0 { compatible = "ti,omap5430-timer"; reg = <0x0 0x80>; - clocks = <&wkupaon_clkctrl DRA7_WKUPAON_TIMER12_CLKCTRL 24>; - clock-names = "fck"; interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; ti,timer-alwon; ti,timer-secure;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 22/138 mwifiex: Fix possible buffer overflows at parsing bss descriptor
In reply to Greg Kroah-Hartman[ Upstream commit 13ec7f10b87f5fc04c4ccbd491c94c7980236a74 ]
mwifiex_update_bss_desc_with_ie() calls memcpy() unconditionally in a couple places without checking the destination size. Since the source is given from user-space, this may trigger a heap buffer overflow.
Fix it by putting the length check before performing memcpy().
This fix addresses CVE-2019-3846.
--- drivers/net/wireless/marvell/mwifiex/scan.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/marvell/mwifiex/scan.c +4 -0
@@ -1247,6 +1247,8 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, }switch (element_id) {case WLAN_EID_SSID : +if (element_len >IEEE80211_MAX_SSID_LEN ) +return -EINVAL ; bss_entry->ssid.ssid_len = element_len;memcpy (bss_entry->ssid.ssid, (current_ptr +2 ), element_len);
@@ -1256,6 +1258,8 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,break ;case WLAN_EID_SUPP_RATES : +if (element_len >MWIFIEX_SUPPORTED_RATES ) +return -EINVAL ;memcpy (bss_entry->data_rates, current_ptr +2 , element_len); memcpy(bss_entry->supported_rates, current_ptr + 2,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 24/138 iwlwifi: fix load in rfkill flow for unified firmware
In reply to Greg Kroah-Hartman[ Upstream commit b3500b472c880b5abe90ffd5c4a25aa736f906ad ]
When we have a single image (same firmware image for INIT and OPERATIONAL), we couldn't load the driver and register to the stack if we had hardware RF-Kill asserted.
Fix this. This required a few changes:
1) Run the firmware as part of the INIT phase even if its ucode_type is not IWL_UCODE_INIT.
2) Send the commands that are sent to the unified image in INIT flow even in RF-Kill.
3) Don't ask the transport to stop the hardware upon RF-Kill interrupt if the RF-Kill is asserted.
4) Allow the RF-Kill interrupt to take us out of L1A so that the RF-Kill interrupt will be received by the host (to enable the radio).
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 ++++++++++++++----- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 17 ++++++++++---- .../wireless/intel/iwlwifi/pcie/internal.h | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +17 -6
@@ -311,6 +311,8 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,int ret;enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img;static const u16 alive_cmd[] = {MVM_ALIVE }; +bool run_in_rfkill = + ucode_type ==IWL_UCODE_INIT ||iwl_mvm_has_unified_ucode (mvm); if (ucode_type == IWL_UCODE_REGULAR && iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) &&
@@ -328,7 +330,12 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm, alive_cmd,ARRAY_SIZE (alive_cmd), iwl_alive_fn, &alive_data); - ret =iwl_trans_start_fw (mvm->trans, fw, ucode_type ==IWL_UCODE_INIT ); +/* +* We want to load the INIT firmware even in RFKILL +* For the unified firmware case, the ucode_type is not +* INIT, but we still need to run it. +*/ + ret =iwl_trans_start_fw (mvm->trans, fw, run_in_rfkill);if (ret) {iwl_fw_set_current_image (&mvm->fwrt, old_type);iwl_remove_notification (&mvm->notif_wait, &alive_wait);
@@ -433,7 +440,8 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)* commands */ ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (SYSTEM_GROUP , -INIT_EXTENDED_CFG_CMD ),0 , +INIT_EXTENDED_CFG_CMD ), +CMD_SEND_IN_RFKILL ,sizeof (init_cfg), &init_cfg);if (ret) { IWL_ERR(mvm, "Failed to run init config command: %d\n",
@@ -457,7 +465,8 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) } ret =iwl_mvm_send_cmd_pdu (mvm,WIDE_ID (REGULATORY_AND_NVM_GROUP , -NVM_ACCESS_COMPLETE ),0 , +NVM_ACCESS_COMPLETE ), +CMD_SEND_IN_RFKILL ,sizeof (nvm_complete), &nvm_complete);if (ret) { IWL_ERR(mvm, "Failed to run complete NVM access: %d\n",
@@ -482,6 +491,8 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) } } + mvm->rfkill_safe_init_done = true; +return 0 ; error:
@@ -526,7 +537,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)lockdep_assert_held (&mvm->mutex); -if (WARN_ON_ONCE (mvm->calibrating)) +if (WARN_ON_ONCE (mvm->rfkill_safe_init_done))return 0 ; iwl_init_notification_wait(&mvm->notif_wait,
@@ -576,7 +587,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) goto remove_notif; } - mvm->calibrating = true; + mvm->rfkill_safe_init_done = true;/* Send TX valid antennas before triggering calibrations */ ret =iwl_send_tx_ant_cfg (mvm,iwl_mvm_get_valid_tx_ant (mvm));
@@ -612,7 +623,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) remove_notif:iwl_remove_notification (&mvm->notif_wait, &calib_wait); out: - mvm->calibrating = false; + mvm->rfkill_safe_init_done = false;if (iwlmvm_mod_params.init_dbg && !mvm->nvm_data) {/* we want to debug INIT and we have no NVM - fake */ mvm->nvm_data = kzalloc(sizeof(struct iwl_nvm_data) +
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 -1
@@ -1211,7 +1211,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) mvm->scan_status =0 ; mvm->ps_disabled = false; - mvm->calibrating = false; + mvm->rfkill_safe_init_done = false;/* just in case one was running */ iwl_mvm_cleanup_roc_te (mvm);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -877,7 +877,7 @@ struct iwl_mvm {struct iwl_mvm_vif *bf_allowed_vif;bool hw_registered; -bool calibrating; +bool rfkill_safe_init_done;bool support_umac_log;u32 ampdu_ref;
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +13 -4
@@ -1222,7 +1222,8 @@ void iwl_mvm_set_hw_ctkill_state(struct iwl_mvm *mvm, bool state)static bool iwl_mvm_set_hw_rfkill_state (struct iwl_op_mode *op_mode,bool state) {struct iwl_mvm *mvm =IWL_OP_MODE_GET_MVM (op_mode); -bool calibrating =READ_ONCE (mvm->calibrating); +bool rfkill_safe_init_done =READ_ONCE (mvm->rfkill_safe_init_done); +bool unified =iwl_mvm_has_unified_ucode (mvm);if (state)set_bit (IWL_MVM_STATUS_HW_RFKILL , &mvm->status);
@@ -1231,15 +1232,23 @@ static bool iwl_mvm_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)iwl_mvm_set_rfkill_state (mvm); -/* iwl_run_init_mvm_ucode is waiting for results, abort it */ -if (calibrating) +/* iwl_run_init_mvm_ucode is waiting for results, abort it. */ +if (rfkill_safe_init_done)iwl_abort_notification_waits (&mvm->notif_wait); +/* +* Don't ask the transport to stop the firmware. We'll do it +* after cfg80211 takes us down. +*/ +if (unified) +return false; +/* * Stop the device if we run OPERATIONAL firmware or if we are in the * middle of the calibrations. */ -return state && (mvm->fwrt.cur_fw_img !=IWL_UCODE_INIT || calibrating); +return state && (mvm->fwrt.cur_fw_img !=IWL_UCODE_INIT || + rfkill_safe_init_done); }static void iwl_mvm_free_skb (struct iwl_op_mode *op_mode,struct sk_buff *skb)
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +1 -1
@@ -948,7 +948,7 @@ static inline void iwl_enable_rfkill_int(struct iwl_trans *trans) MSIX_HW_INT_CAUSES_REG_RF_KILL); } -if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_9000 ) { +if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_9000 ) {/* * On 9000-series devices this bit isn't enabled by default, so * when we power down the device we need set the bit to allow it
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 23/138 bpf, riscv: clear high 32 bits for ALU32 add/sub/neg/lsh/rsh/arsh
In reply to Greg Kroah-Hartman[ Upstream commit 1e692f09e091bf5c8b38384f297d6dae5dbf0f12 ]
In BPF, 32-bit ALU operations should zero-extend their results into the 64-bit registers.
The current BPF JIT on RISC-V emits incorrect instructions that perform sign extension only (e.g., addw, subw) on 32-bit add, sub, lsh, rsh, arsh, and neg. This behavior diverges from the interpreter and JITs for other architectures.
This patch fixes the bugs by performing zero extension on the destination register of 32-bit ALU operations.
--- arch/riscv/net/bpf_jit_comp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/riscv/net/bpf_jit_comp.c +18 -0
@@ -751,10 +751,14 @@ static int emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,case BPF_ALU |BPF_ADD |BPF_X :case BPF_ALU64 |BPF_ADD |BPF_X :emit (is64 ?rv_add (rd, rd, rs) :rv_addw (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_SUB |BPF_X :case BPF_ALU64 |BPF_SUB |BPF_X :emit (is64 ?rv_sub (rd, rd, rs) :rv_subw (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_AND |BPF_X :case BPF_ALU64 |BPF_AND |BPF_X :
@@ -795,14 +799,20 @@ static int emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,case BPF_ALU |BPF_LSH |BPF_X :case BPF_ALU64 |BPF_LSH |BPF_X :emit (is64 ?rv_sll (rd, rd, rs) :rv_sllw (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_RSH |BPF_X :case BPF_ALU64 |BPF_RSH |BPF_X :emit (is64 ?rv_srl (rd, rd, rs) :rv_srlw (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_ARSH |BPF_X :case BPF_ALU64 |BPF_ARSH |BPF_X :emit (is64 ?rv_sra (rd, rd, rs) :rv_sraw (rd, rd, rs), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;/* dst = -dst */
@@ -810,6 +820,8 @@ static int emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,case BPF_ALU64 |BPF_NEG :emit (is64 ?rv_sub (rd,RV_REG_ZERO , rd) :rv_subw (rd,RV_REG_ZERO , rd), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;/* dst = BSWAP##imm(dst) */
@@ -964,14 +976,20 @@ static int emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,case BPF_ALU |BPF_LSH |BPF_K :case BPF_ALU64 |BPF_LSH |BPF_K :emit (is64 ?rv_slli (rd, rd, imm) :rv_slliw (rd, rd, imm), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_RSH |BPF_K :case BPF_ALU64 |BPF_RSH |BPF_K :emit (is64 ?rv_srli (rd, rd, imm) :rv_srliw (rd, rd, imm), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;case BPF_ALU |BPF_ARSH |BPF_K :case BPF_ALU64 |BPF_ARSH |BPF_K :emit (is64 ?rv_srai (rd, rd, imm) :rv_sraiw (rd, rd, imm), ctx); +if (!is64) +emit_zext_32 (rd, ctx);break ;/* JUMP off */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 3/138 crypto: talitos - rename alternative AEAD algos.
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit a1a42f84011fae6ff08441a91aefeb7febc984fc upstream.
The talitos driver has two ways to perform AEAD depending on the HW capability. Some HW support both. It is needed to give them different names to distingish which one it is for instance when a test fails.
--- drivers/crypto/talitos.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/talitos.c +8 -8
@@ -2299,7 +2299,7 @@ static struct talitos_alg_template drive .base = { .cra_name = "authenc(hmac(sha1),cbc(aes))", .cra_driver_name ="authenc-hmac-sha1-" - "cbc-aes-talitos", + "cbc-aes-talitos-hsna", .cra_blocksize = AES_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2343,7 +2343,7 @@ static struct talitos_alg_template drive .cra_name = "authenc(hmac(sha1)," "cbc(des3_ede))", .cra_driver_name ="authenc-hmac-sha1-" - "cbc-3des-talitos", + "cbc-3des-talitos-hsna", .cra_blocksize = DES3_EDE_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2385,7 +2385,7 @@ static struct talitos_alg_template drive .base = { .cra_name = "authenc(hmac(sha224),cbc(aes))", .cra_driver_name ="authenc-hmac-sha224-" - "cbc-aes-talitos", + "cbc-aes-talitos-hsna", .cra_blocksize = AES_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2429,7 +2429,7 @@ static struct talitos_alg_template drive .cra_name = "authenc(hmac(sha224)," "cbc(des3_ede))", .cra_driver_name ="authenc-hmac-sha224-" - "cbc-3des-talitos", + "cbc-3des-talitos-hsna", .cra_blocksize = DES3_EDE_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2471,7 +2471,7 @@ static struct talitos_alg_template drive .base = { .cra_name = "authenc(hmac(sha256),cbc(aes))", .cra_driver_name ="authenc-hmac-sha256-" - "cbc-aes-talitos", + "cbc-aes-talitos-hsna", .cra_blocksize = AES_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2515,7 +2515,7 @@ static struct talitos_alg_template drive .cra_name = "authenc(hmac(sha256)," "cbc(des3_ede))", .cra_driver_name ="authenc-hmac-sha256-" - "cbc-3des-talitos", + "cbc-3des-talitos-hsna", .cra_blocksize = DES3_EDE_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2641,7 +2641,7 @@ static struct talitos_alg_template drive .base = { .cra_name = "authenc(hmac(md5),cbc(aes))", .cra_driver_name ="authenc-hmac-md5-" - "cbc-aes-talitos", + "cbc-aes-talitos-hsna", .cra_blocksize = AES_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
@@ -2683,7 +2683,7 @@ static struct talitos_alg_template drive .base = { .cra_name = "authenc(hmac(md5),cbc(des3_ede))", .cra_driver_name ="authenc-hmac-md5-" - "cbc-3des-talitos", + "cbc-3des-talitos-hsna", .cra_blocksize = DES3_EDE_BLOCK_SIZE, .cra_flags = CRYPTO_ALG_ASYNC, },
Greg Kroah-Hartman
maintainerPATCH 4/138 ARM: dts: dra76x: Disable rtc target module
In reply to Greg Kroah-Hartman[ Upstream commit f7b9cb944a5d41fdede4e928a47e9d5fce5169d7 ]
rtc is fused out on dra76 and accessing target module register is causing a boot crash hence disable it.
--- arch/arm/boot/dts/dra7-l4.dtsi | 2 +- arch/arm/boot/dts/dra76x.dtsi | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm/boot/dts/dra7-l4.dtsi +1 -1
@@ -3543,7 +3543,7 @@ }; }; - target-module@38000 { /* 0x48838000, ap 29 12.0 */ + rtctarget: target-module@38000 { /* 0x48838000, ap 29 12.0 */ compatible = "ti,sysc-omap4-simple", "ti,sysc"; ti,hwmods = "rtcss"; reg = <0x38074 0x4>,
arch/arm/boot/dts/dra76x.dtsi +4 -0
@@ -81,3 +81,7 @@ reg = <0x3fc>; }; }; + +&rtctarget { + status = "disabled"; +};
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 6/138 ARM: dts: dra71x: Disable rtc target module
In reply to Greg Kroah-Hartman[ Upstream commit fe9edfe648ac444150ec95da1fb10e2728cc9789 ]
Introduce dra71x.dtsi to include dra71x specific changes. rtc is fused out on dra71 and accessing target module register is causing a boot crash hence disable it.
--- arch/arm/boot/dts/dra71-evm.dts | 2 +- arch/arm/boot/dts/dra71x.dtsi | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/dra71x.dtsi
arch/arm/boot/dts/dra71-evm.dts +1 -1
@@ -6,7 +6,7 @@ * published by the Free Software Foundation. */ -#include "dra72-evm-common.dtsi" +#include "dra71x.dtsi" #include "dra7-mmc-iodelay.dtsi" #include "dra72x-mmc-iodelay.dtsi" #include <dt-bindings/net/ti-dp83867.h>
arch/arm/boot/dts/dra71x.dtsi new file +13 -0
@@ -0,0 +1,13 @@ +/* + * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "dra72-evm-common.dtsi" + +&rtctarget { + status = "disabled"; +};
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 5/138 ARM: dts: dra76x: Disable usb4_tm target module
In reply to Greg Kroah-Hartman[ Upstream commit b07bd27e02b9108ce8412cc2dc6faf621f57d224 ]
usb4_tm is unsed on dra76 and accessing the module with ti,sysc is causing a boot crash hence disable its target module.
--- arch/arm/boot/dts/dra76x.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/dra76x.dtsi +4 -0
@@ -85,3 +85,7 @@ &rtctarget { status = "disabled"; }; + +&usb4_tm { + status = "disabled"; +};
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 7/138 ARM: dts: dra71x: Disable usb4_tm target module
In reply to Greg Kroah-Hartman[ Upstream commit 34b1b8061de3215208db9accfe60cc3f5b40178f ]
usb4_tm is unsed on dra71 and accessing the module with ti,sysc is causing a boot crash hence disable its target module.
--- arch/arm/boot/dts/dra71x.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/dra71x.dtsi +4 -0
@@ -11,3 +11,7 @@ &rtctarget { status = "disabled"; }; + +&usb4_tm { + status = "disabled"; +};
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 9/138 soc: bcm: brcmstb: biuctrl: Register writes require a barrier
In reply to Greg Kroah-Hartman[ Upstream commit 6b23af0783a54efb348f0bd781b7850636023dbb ]
The BIUCTRL register writes require that a data barrier be inserted after comitting the write to the register for the block to latch in the recently written values. Reads have no such requirement and are not changed.
--- drivers/soc/bcm/brcmstb/biuctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/bcm/brcmstb/biuctrl.c +1 -1
@@ -56,7 +56,7 @@ static inline void cbc_writel(u32 val, int reg)if (offset ==-1 )return ; -writel_relaxed (val, cpubiuctrl_base + offset); +writel (val, cpubiuctrl_base + offset); }enum cpubiuctrl_regs {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainercover 5.1.18-stable review
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.1.18-rc1
Arnd Bergmann <[email protected]>
staging: rtl8712: reduce stack usage, again
Dave Stevenson <[email protected]>
staging: bcm2835-camera: Handle empty EOS buffers whilst streaming
Dave Stevenson <[email protected]>
staging: bcm2835-camera: Remove check of the number of buffers supplied
Dave Stevenson <[email protected]>
staging: bcm2835-camera: Ensure all buffers are returned on disable
Dave Stevenson <[email protected]>
staging: bcm2835-camera: Replace spinlock protecting context_map with mutex
Colin Ian King <[email protected]>
staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
Nicolas Saenz Julienne <[email protected]>
staging: vchiq: make wait events interruptible
Nicolas Saenz Julienne <[email protected]>
staging: vchiq: revert "switch to wait_for_completion_killable"
Nicolas Saenz Julienne <[email protected]>
staging: vchiq_2835_arm: revert "quit using custom down_interruptible()"
Vishnu DASA <[email protected]>
VMCI: Fix integer overflow in VMCI handle arrays
Christian Lamparter <[email protected]>
carl9170: fix misuse of device driver API
Fabrice Gasnier <[email protected]>
iio: adc: stm32-adc: add missing vdda-supply
Todd Kjos <[email protected]>
binder: return errors from buffer copy functions
Todd Kjos <[email protected]>
binder: fix memory leak in error path
Nick Desaulniers <[email protected]>
lkdtm: support llvm-objcopy
Sebastian Parschauer <[email protected]>
HID: Add another Primax PIXART OEM mouse quirk
Sergio Paracuellos <[email protected]>
staging: mt7621-pci: fix PCIE_FTS_NUM_LO macro
Ian Abbott <[email protected]>
staging: comedi: amplc_pci230: fix null pointer deref on interrupt
Ajay Singh <[email protected]>
staging: wilc1000: fix error path cleanup in wilc_wlan_initialize()
Ian Abbott <[email protected]>
staging: comedi: dt282x: fix a null pointer deref on interrupt
Christian Lamparter <[email protected]>
p54: fix crash during initialization
Nikolaus Voss <[email protected]>
drivers/usb/typec/tps6598x.c: fix 4CC cmd write
Nikolaus Voss <[email protected]>
drivers/usb/typec/tps6598x.c: fix portinfo width
Yoshihiro Shimoda <[email protected]>
usb: renesas_usbhs: add a workaround for a race condition of workqueue
Martin Blumenstingl <[email protected]>
usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset()
Kiruthika Varadarajan <[email protected]>
usb: gadget: ether: Fix race between gether_disconnect and rx_submit
Fei Yang <[email protected]>
usb: gadget: f_fs: data_len used before properly set
Alan Stern <[email protected]>
p54usb: Fix race between disconnect and firmware loading
Oliver Barta <[email protected]>
Revert "serial: 8250: Don't service RX FIFO if interrupts are disabled"
Jörgen Storvist <[email protected]>
USB: serial: option: add support for GosunCn ME3630 RNDIS mode
Andreas Fritiofson <[email protected]>
USB: serial: ftdi_sio: add ID for isodebug v1
Brian Norris <[email protected]>
mwifiex: Don't abort on small, spec-compliant vendor IEs
Takashi Iwai <[email protected]>
mwifiex: Abort at too short BSS descriptor element
Andy Lutomirski <[email protected]>
Documentation/admin: Remove the vsyscall=native documentation
Tim Chen <[email protected]>
Documentation: Add section about CPU vulnerabilities for Spectre
Dianzhang Chen <[email protected]>
x86/tls: Fix possible spectre-v1 in do_get_thread_area()
Dianzhang Chen <[email protected]>
x86/ptrace: Fix possible spectre-v1 in ptrace_get_debugreg()
Song Liu <[email protected]>
perf header: Assign proper ff->ph in perf_event__synthesize_features()
Adrian Hunter <[email protected]>
perf thread-stack: Fix thread stack return from kernel for kernel-only case
John Garry <[email protected]>
perf pmu: Fix uncore PMU alias list for ARM64
Adrian Hunter <[email protected]>
perf intel-pt: Fix itrace defaults for perf script intel-pt documentation
Adrian Hunter <[email protected]>
perf auxtrace: Fix itrace defaults for perf script
Adrian Hunter <[email protected]>
perf intel-pt: Fix itrace defaults for perf script
Douglas Anderson <[email protected]>
block, bfq: NULL out the bic when it's no longer valid
Vadim Sukhomlinov <[email protected]>
tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
Kees Cook <[email protected]>
tpm: Actually fail on TPM errors during "get random"
Kailang Yang <[email protected]>
ALSA: hda/realtek - Headphone Mic can't record after S3
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix parse of UAC2 Extension Units
Mauro Carvalho Chehab <[email protected]>
media: stv0297: fix frequency range limit
Steven J. Magnani <[email protected]>
udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
Hongjie Fang <[email protected]>
fscrypt: don't set policy for a dead directory
Benjamin Coddington <[email protected]>
NFS4: Only set creation opendata if O_CREAT
Andrew Jones <[email protected]>
KVM: arm/arm64: Fix emulated ptimer irq injection
Rasmus Villemoes <[email protected]>
net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6185_g1_vtu_loadpurge()
yangerkun <[email protected]>
quota: fix a problem about transfer quota
Christoph Hellwig <[email protected]>
powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac
Nilesh Javali <[email protected]>
scsi: qedi: Check targetname while finding boot target information
Colin Ian King <[email protected]>
net: lio_core: fix potential sign-extension overflow on large shift
Xin Long <[email protected]>
ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
Dan Carpenter <[email protected]>
drm: return -EFAULT if copy_to_user() fails
Mauro S. M. Rodrigues <[email protected]>
bnx2x: Check if transceiver implements DDM before access
Mariusz Tkaczyk <[email protected]>
md: fix for divide error in status_resync
Mike Marciniszyn <[email protected]>
IB/hfi1: Handle port down properly in pio
Mike Marciniszyn <[email protected]>
IB/hfi1: Handle wakeup of orphaned QPs for pio
Mike Marciniszyn <[email protected]>
IB/hfi1: Wakeup QPs orphaned on wait list after flush
Mike Marciniszyn <[email protected]>
IB/hfi1: Use aborts to trigger RC throttling
Mike Marciniszyn <[email protected]>
IB/hfi1: Create inline to get extended headers
Wolfram Sang <[email protected]>
mmc: core: complete HS400 before checking status
Reinhard Speyerer <[email protected]>
qmi_wwan: extend permitted QMAP mux_id value range
Reinhard Speyerer <[email protected]>
qmi_wwan: avoid RCU stalls on device disconnect when in QMAP mode
Reinhard Speyerer <[email protected]>
qmi_wwan: add support for QMAP padding in the RX path
Alexei Starovoitov <[email protected]>
bpf, x64: fix stack layout of JITed bpf code
Toshiaki Makita <[email protected]>
bpf, devmap: Add missing RCU read lock on flush
Toshiaki Makita <[email protected]>
bpf, devmap: Add missing bulk queue free
Toshiaki Makita <[email protected]>
bpf, devmap: Fix premature entry free on destroying map
Avraham Stern <[email protected]>
cfg80211: report measurement start TSF correctly
Mordechay Goodstein <[email protected]>
cfg80211: util: fix bit count off by one
Naftali Goldstein <[email protected]>
mac80211: do not start any work during reconfigure flow
Yibo Zhao <[email protected]>
mac80211: only warn once on chanctx_conf being NULL
Steve Longerbeam <[email protected]>
gpu: ipu-v3: image-convert: Fix image downsize coefficients
Steve Longerbeam <[email protected]>
gpu: ipu-v3: image-convert: Fix input bytesperline for packed formats
Steve Longerbeam <[email protected]>
gpu: ipu-v3: image-convert: Fix input bytesperline width/height align
Bartosz Golaszewski <[email protected]>
ARM: davinci: da8xx: specify dma_coherent_mask for lcdc
Bartosz Golaszewski <[email protected]>
ARM: davinci: da850-evm: call regulator_has_full_constraints()
Naveen N. Rao <[email protected]>
bpf: fix div64 overflow tests to properly detect errors
Vitaly Kuznetsov <[email protected]>
KVM: nVMX: use correct clean fields when copying from eVMCS
Ido Schimmel <[email protected]>
mlxsw: spectrum: Disallow prio-tagged packets when PVID is removed
Dave Martin <[email protected]>
KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy
Ilya Maximets <[email protected]>
xdp: check device pointer before clearing
Anson Huang <[email protected]>
Input: imx_keypad - make sure keyboard can always wake up system
Nick Hu <[email protected]>
riscv: Fix udelay in RV32.
Qian Cai <[email protected]>
drm/vmwgfx: fix a warning due to missing dma_parms
Thomas Hellstrom <[email protected]>
drm/vmwgfx: Honor the sg list segment size limitation
Kevin Hilman <[email protected]>
RISC-V: defconfig: enable clocks, serial console
Heiko Carstens <[email protected]>
s390/boot: disable address-of-packed-member warning
Teresa Remmet <[email protected]>
ARM: dts: am335x phytec boards: Fix cd-gpios active level
Thomas Falcon <[email protected]>
ibmvnic: Fix unchecked return codes of memory allocations
Thomas Falcon <[email protected]>
ibmvnic: Refresh device multicast list after reset
Thomas Falcon <[email protected]>
ibmvnic: Do not close unopened driver during reset
Michael Schmitz <[email protected]>
net: phy: rename Asix Electronics PHY driver
Fabio Estevam <[email protected]>
can: flexcan: Remove unneeded registration message
YueHaibing <[email protected]>
can: af_can: Fix error path of can_init()
Eugen Hristev <[email protected]>
can: m_can: implement errata "Needless activation of MRAF irq"
Sean Nyekjaer <[email protected]>
can: mcp251x: add support for mcp25625
Sean Nyekjaer <[email protected]>
dt-bindings: can: mcp251x: add mcp25625 support
Guillaume Nault <[email protected]>
netfilter: ipv6: nf_defrag: accept duplicate fragments again
Srinivas Kandagatla <[email protected]>
soundwire: intel: set dai min and max channels correctly
Srinivas Kandagatla <[email protected]>
soundwire: stream: fix bad unlock balance
Krzesimir Nowak <[email protected]>
tools: bpftool: Fix JSON output when lookup fails
Guillaume Nault <[email protected]>
netfilter: ipv6: nf_defrag: fix leakage of unqueued fragments
Takashi Iwai <[email protected]>
mwifiex: Fix heap overflow in mwifiex_uap_parse_tail_ies()
Jia-Ju Bai <[email protected]>
iwlwifi: Fix double-free problems in iwl_req_fw_callback()
Matt Chen <[email protected]>
iwlwifi: fix AX201 killer sku loading firmware issue
Shahar S Matityahu <[email protected]>
iwlwifi: clear persistence bit according to device family
Emmanuel Grumbach <[email protected]>
iwlwifi: fix load in rfkill flow for unified firmware
Luke Nelson <[email protected]>
bpf, riscv: clear high 32 bits for ALU32 add/sub/neg/lsh/rsh/arsh
Takashi Iwai <[email protected]>
mwifiex: Fix possible buffer overflows at parsing bss descriptor
Tony Lindgren <[email protected]>
ARM: dts: Drop bogus CLKSEL for timer12 on dra7
Pradeep Kumar Chitrapu <[email protected]>
mac80211: free peer keys before vif down in mesh
Thomas Pedersen <[email protected]>
mac80211: mesh: fix RCU warning
Melissa Wen <[email protected]>
staging:iio:ad7150: fix threshold mode config bit
Srinivas Kandagatla <[email protected]>
soundwire: stream: fix out of boundary access on port properties
John Fastabend <[email protected]>
bpf: sockmap, fix use after free from sleep in psock backlog workqueue
John Crispin <[email protected]>
mac80211: fix rate reporting inside cfg80211_calculate_bitrate_he()
Jakub Sitnicki <[email protected]>
bpf: sockmap, restore sk_write_space when psock gets dropped
Björn Töpel <[email protected]>
bpf, riscv: clear target register high 32-bits for and/or/xor on ALU32
Matteo Croce <[email protected]>
samples, bpf: suppress compiler warning
Chang-Hsien Tsai <[email protected]>
samples, bpf: fix to change the buffer size for read()
Aaron Ma <[email protected]>
Input: elantech - enable middle button support on 2 ThinkPads
Florian Fainelli <[email protected]>
soc: bcm: brcmstb: biuctrl: Register writes require a barrier
Florian Fainelli <[email protected]>
soc: brcmstb: Fix error path for unsupported CPUs
Keerthy <[email protected]>
ARM: dts: dra71x: Disable usb4_tm target module
Keerthy <[email protected]>
ARM: dts: dra71x: Disable rtc target module
Keerthy <[email protected]>
ARM: dts: dra76x: Disable usb4_tm target module
Keerthy <[email protected]>
ARM: dts: dra76x: Disable rtc target module
Christophe Leroy <[email protected]>
crypto: talitos - rename alternative AEAD algos.
Eric Biggers <[email protected]>
crypto: lrw - use correct alignmask
Christophe Leroy <[email protected]>
crypto: talitos - fix hash on SEC1.
-------------
Diffstat:
Documentation/ABI/testing/sysfs-class-net-qmi | 4 +-
Documentation/admin-guide/hw-vuln/index.rst | 1 +
Documentation/admin-guide/hw-vuln/spectre.rst | 697 +++++++++++++++++++++
Documentation/admin-guide/kernel-parameters.txt | 6 -
.../bindings/net/can/microchip,mcp251x.txt | 1 +
Documentation/userspace-api/spec_ctrl.rst | 2 +
Makefile | 4 +-
arch/arm/boot/dts/am335x-pcm-953.dtsi | 2 +-
arch/arm/boot/dts/am335x-wega.dtsi | 2 +-
arch/arm/boot/dts/dra7-l4.dtsi | 4 +-
arch/arm/boot/dts/dra71-evm.dts | 2 +-
arch/arm/boot/dts/dra71x.dtsi | 17 +
arch/arm/boot/dts/dra76x.dtsi | 8 +
arch/arm/mach-davinci/board-da850-evm.c | 2 +
arch/arm/mach-davinci/devices-da8xx.c | 3 +
arch/powerpc/include/asm/page.h | 7 +
arch/powerpc/mm/mem.c | 3 +-
arch/powerpc/platforms/powermac/Kconfig | 1 +
arch/riscv/configs/defconfig | 4 +
arch/riscv/lib/delay.c | 2 +-
arch/riscv/net/bpf_jit_comp.c | 24 +
arch/s390/Makefile | 1 +
arch/x86/kernel/ptrace.c | 5 +-
arch/x86/kernel/tls.c | 9 +-
arch/x86/kvm/vmx/nested.c | 4 +-
arch/x86/net/bpf_jit_comp.c | 74 +--
block/bfq-iosched.c | 1 +
crypto/lrw.c | 2 +-
drivers/android/binder.c | 157 +++--
drivers/android/binder_alloc.c | 44 +-
drivers/android/binder_alloc.h | 22 +-
drivers/char/tpm/tpm-chip.c | 6 +-
drivers/char/tpm/tpm1-cmd.c | 7 +-
drivers/char/tpm/tpm2-cmd.c | 7 +-
drivers/crypto/talitos.c | 85 +--
drivers/gpu/drm/drm_bufs.c | 5 +-
drivers/gpu/drm/drm_ioc32.c | 5 +-
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 +
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 10 +-
drivers/gpu/ipu-v3/ipu-image-convert.c | 40 +-
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
drivers/iio/adc/stm32-adc-core.c | 21 +-
drivers/infiniband/hw/hfi1/hfi.h | 31 +
drivers/infiniband/hw/hfi1/pio.c | 21 +-
drivers/infiniband/hw/hfi1/rc.c | 53 +-
drivers/infiniband/hw/hfi1/sdma.c | 17 +
drivers/infiniband/hw/hfi1/ud.c | 4 +-
drivers/infiniband/hw/hfi1/verbs.c | 14 +-
drivers/infiniband/hw/hfi1/verbs.h | 1 +
drivers/input/keyboard/imx_keypad.c | 18 +-
drivers/input/mouse/elantech.c | 2 +
drivers/md/md.c | 36 +-
drivers/media/dvb-frontends/stv0297.c | 2 +-
drivers/misc/lkdtm/Makefile | 3 +-
drivers/misc/vmw_vmci/vmci_context.c | 80 +--
drivers/misc/vmw_vmci/vmci_handle_array.c | 38 +-
drivers/misc/vmw_vmci/vmci_handle_array.h | 29 +-
drivers/mmc/core/mmc.c | 6 +-
drivers/net/can/flexcan.c | 3 -
drivers/net/can/m_can/m_can.c | 21 +
drivers/net/can/spi/Kconfig | 5 +-
drivers/net/can/spi/mcp251x.c | 25 +-
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 2 +-
drivers/net/ethernet/8390/Kconfig | 2 +-
.../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 +
drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +-
drivers/net/ethernet/ibm/ibmvnic.c | 19 +-
drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +-
drivers/net/phy/Kconfig | 2 +-
drivers/net/phy/Makefile | 2 +-
drivers/net/phy/{asix.c => ax88796b.c} | 0
drivers/net/usb/qmi_wwan.c | 27 +-
drivers/net/wireless/ath/carl9170/usb.c | 39 +-
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 -
drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 7 +-
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 +-
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 17 +-
drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 2 +-
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 50 +-
drivers/net/wireless/intersil/p54/p54usb.c | 43 +-
drivers/net/wireless/intersil/p54/txrx.c | 5 +-
drivers/net/wireless/marvell/mwifiex/fw.h | 12 +-
drivers/net/wireless/marvell/mwifiex/ie.c | 47 +-
drivers/net/wireless/marvell/mwifiex/scan.c | 31 +-
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 4 +-
drivers/net/wireless/marvell/mwifiex/wmm.c | 2 +-
drivers/scsi/qedi/qedi_main.c | 3 +
drivers/soc/bcm/brcmstb/biuctrl.c | 6 +-
drivers/soundwire/intel.c | 4 +-
drivers/soundwire/stream.c | 7 +-
drivers/staging/comedi/drivers/amplc_pci230.c | 3 +-
drivers/staging/comedi/drivers/dt282x.c | 3 +-
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 1 +
drivers/staging/iio/cdc/ad7150.c | 19 +-
drivers/staging/mt7621-pci/pci-mt7621.c | 2 +-
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 157 +++--
.../vc04_services/bcm2835-camera/bcm2835-camera.c | 43 +-
.../vc04_services/bcm2835-camera/mmal-vchiq.c | 32 +-
.../vc04_services/bcm2835-camera/mmal-vchiq.h | 3 +
.../interface/vchiq_arm/vchiq_2835_arm.c | 2 +-
.../vc04_services/interface/vchiq_arm/vchiq_arm.c | 21 +-
.../vc04_services/interface/vchiq_arm/vchiq_core.c | 31 +-
.../vc04_services/interface/vchiq_arm/vchiq_util.c | 6 +-
drivers/staging/wilc1000/wilc_netdev.c | 12 +-
drivers/tty/serial/8250/8250_port.c | 3 +-
drivers/usb/dwc2/core.c | 2 +-
drivers/usb/gadget/function/f_fs.c | 3 +-
drivers/usb/gadget/function/u_ether.c | 6 +-
drivers/usb/renesas_usbhs/fifo.c | 34 +-
drivers/usb/serial/ftdi_sio.c | 1 +
drivers/usb/serial/ftdi_sio_ids.h | 6 +
drivers/usb/serial/option.c | 1 +
drivers/usb/typec/tps6598x.c | 6 +-
fs/crypto/policy.c | 2 +
fs/nfs/nfs4proc.c | 20 +-
fs/quota/dquot.c | 4 +-
fs/udf/inode.c | 93 ++-
include/linux/skmsg.h | 2 +
include/linux/vmw_vmci_defs.h | 11 +-
include/net/ip6_tunnel.h | 9 +-
include/uapi/linux/usb/audio.h | 37 ++
kernel/bpf/devmap.c | 9 +-
net/can/af_can.c | 24 +-
net/core/skbuff.c | 1 +
net/ipv6/netfilter/nf_conntrack_reasm.c | 22 +-
net/mac80211/ieee80211_i.h | 9 +-
net/mac80211/mesh.c | 6 +-
net/mac80211/util.c | 4 +
net/wireless/pmsr.c | 4 +-
net/wireless/util.c | 4 +-
net/xdp/xdp_umem.c | 11 +-
samples/bpf/bpf_load.c | 2 +-
samples/bpf/task_fd_query_user.c | 2 +-
sound/pci/hda/patch_realtek.c | 2 +-
sound/usb/mixer.c | 16 +-
tools/bpf/bpftool/map.c | 2 +
tools/perf/Documentation/intel-pt.txt | 10 +-
tools/perf/util/auxtrace.c | 3 +-
tools/perf/util/header.c | 1 +
tools/perf/util/intel-pt.c | 3 +-
tools/perf/util/pmu.c | 28 +-
tools/perf/util/thread-stack.c | 30 +-
.../testing/selftests/bpf/verifier/div_overflow.c | 14 +-
virt/kvm/arm/arch_timer.c | 5 +-
virt/kvm/arm/vgic/vgic-its.c | 1 +
149 files changed, 2097 insertions(+), 775 deletions(-)Greg Kroah-Hartman
maintainerPATCH 37/138 can: af_can: Fix error path of can_init()
[ Upstream commit c5a3aed1cd3152429348ee1fe5cdcca65fe901ce ]
This patch add error path for can_init() to avoid possible crash if some error occurs.
--- net/can/af_can.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
net/can/af_can.c +21 -3
@@ -959,6 +959,8 @@ static struct pernet_operations can_pernet_ops __read_mostly = {static __init int can_init (void ) { +int err; +/* check for correct padding to be able to use the structs similarly */ BUILD_BUG_ON(offsetof(struct can_frame, can_dlc) != offsetof(struct canfd_frame, len) ||
@@ -972,15 +974,31 @@ static __init int can_init(void)if (!rcv_cache)return -ENOMEM ; -register_pernet_subsys (&can_pernet_ops); + err =register_pernet_subsys (&can_pernet_ops); +if (err) + goto out_pernet;/* protocol register */ -sock_register (&can_family_ops); -register_netdevice_notifier (&can_netdev_notifier); + err =sock_register (&can_family_ops); +if (err) + goto out_sock; + err =register_netdevice_notifier (&can_netdev_notifier); +if (err) + goto out_notifier; +dev_add_pack (&can_packet);dev_add_pack (&canfd_packet);return 0 ; + +out_notifier: +sock_unregister (PF_CAN ); +out_sock: +unregister_pernet_subsys (&can_pernet_ops); +out_pernet: +kmem_cache_destroy (rcv_cache); + +return err; } static __exit void can_exit(void)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 36/138 can: m_can: implement errata "Needless activation of MRAF irq"
In reply to Greg Kroah-Hartman[ Upstream commit 3e82f2f34c930a2a0a9e69fdc2de2f2f1388b442 ]
During frame reception while the MCAN is in Error Passive state and the Receive Error Counter has thevalue MCAN_ECR.REC = 127, it may happen that MCAN_IR.MRAF is set although there was no Message RAM access failure. If MCAN_IR.MRAF is enabled, an interrupt to the Host CPU is generated.
Work around:
The Message RAM Access Failure interrupt routine needs to check whether
MCAN_ECR.RP = '1' and MCAN_ECR.REC = '127'.
In this case, reset MCAN_IR.MRAF. No further action is required. This affects versions older than 3.2.0
Errata explained on Sama5d2 SoC which includes this hardware block:
http://ww1.microchip.com/downloads/en/DeviceDoc/SAMA5D2-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000803B.pdf
chapter 6.2
Reproducibility: If 2 devices with m_can are connected back to back, configuring different bitrate on them will lead to interrupt storm on the receiving side, with error "Message RAM access failure occurred". Another way is to have a bad hardware connection. Bad wire connection can lead to this issue as well.
This patch fixes the issue according to provided workaround.
--- drivers/net/can/m_can/m_can.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/net/can/m_can/m_can.c +21 -0
@@ -822,6 +822,27 @@ static int m_can_poll(struct napi_struct *napi, int quota)if (!irqstatus) goto end; +/* Errata workaround for issue "Needless activation of MRAF irq" +* During frame reception while the MCAN is in Error Passive state +* and the Receive Error Counter has the value MCAN_ECR.REC = 127, +* it may happen that MCAN_IR.MRAF is set although there was no +* Message RAM access failure. +* If MCAN_IR.MRAF is enabled, an interrupt to the Host CPU is generated +* The Message RAM Access Failure interrupt routine needs to check +* whether MCAN_ECR.RP = ’1’ and MCAN_ECR.REC = 127. +* In this case, reset MCAN_IR.MRAF. No further action is required. +*/ +if ((priv->version <=31 ) && (irqstatus &IR_MRAF ) && + (m_can_read (priv,M_CAN_ECR ) &ECR_RP )) { +struct can_berr_counter bec; + +__m_can_get_berr_counter (dev, &bec); +if (bec.rxerr ==127 ) { +m_can_write (priv,M_CAN_IR ,IR_MRAF ); + irqstatus &= ~IR_MRAF ; + } + } + psr =m_can_read (priv,M_CAN_PSR );if (irqstatus &IR_ERR_STATE ) work_done +=m_can_handle_state_errors (dev, psr);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 38/138 can: flexcan: Remove unneeded registration message
In reply to Greg Kroah-Hartman[ Upstream commit eb503004a7e563d543c9cb869907156de7efe720 ]
Currently the following message is observed when the flexcan driver is probed:
flexcan 2090000.flexcan: device registered (reg_base=(ptrval), irq=23)
The reason for printing 'ptrval' is explained atDocumentation/core-api/printk-formats.rst:
"Pointers printed without a specifier extension (i.e unadorned %p) are hashed to prevent leaking information about the kernel memory layout. This has the added benefit of providing a unique identifier. On 64-bit machines the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it gathers enough entropy."
Instead of passing %pK, which can print the correct address, simply remove the entire message as it is not really that useful.
--- drivers/net/can/flexcan.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/can/flexcan.c +0 -3
@@ -1583,9 +1583,6 @@ static int flexcan_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"failed to setup stop-mode\n" ); } -dev_info (&pdev->dev,"device registered (reg_base=%p, irq=%d)\n" , - priv->regs, dev->irq); -return 0 ; failed_register:
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 41/138 ibmvnic: Refresh device multicast list after reset
In reply to Greg Kroah-Hartman[ Upstream commit be32a24372cf162e825332da1a7ccef058d4f20b ]
It was observed that multicast packets were no longer received after a device reset. The fix is to resend the current multicast list to the backing device after recovery.
--- drivers/net/ethernet/ibm/ibmvnic.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/ibm/ibmvnic.c +3 -0
@@ -1851,6 +1851,9 @@ static int do_reset(struct ibmvnic_adapter *adapter,return 0 ; } +/* refresh device's multicast list */ +ibmvnic_set_multi (netdev); +/* kick napi */ for (i =0 ; i < adapter->req_rx_queues; i++)napi_schedule (&adapter->napi[i]);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 42/138 ibmvnic: Fix unchecked return codes of memory allocations
In reply to Greg Kroah-Hartman[ Upstream commit 7c940b1a5291e5069d561f5b8f0e51db6b7a259a ]
The return values for these memory allocations are unchecked, which may cause an oops if the driver does not handle them after a failure. Fix by checking the function's return code.
--- drivers/net/ethernet/ibm/ibmvnic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +7 -6
@@ -438,9 +438,10 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter)if (rx_pool->buff_size !=be64_to_cpu (size_array[i])) {free_long_term_buff (adapter, &rx_pool->long_term_buff); rx_pool->buff_size =be64_to_cpu (size_array[i]); -alloc_long_term_buff (adapter, &rx_pool->long_term_buff, - rx_pool->size * - rx_pool->buff_size); + rc =alloc_long_term_buff (adapter, + &rx_pool->long_term_buff, + rx_pool->size * + rx_pool->buff_size); }else { rc =reset_long_term_buff (adapter, &rx_pool->long_term_buff);
@@ -706,9 +707,9 @@ static int init_tx_pools(struct net_device *netdev)return rc; } -init_one_tx_pool (netdev, &adapter->tso_pool[i], -IBMVNIC_TSO_BUFS , -IBMVNIC_TSO_BUF_SZ ); + rc =init_one_tx_pool (netdev, &adapter->tso_pool[i], +IBMVNIC_TSO_BUFS , +IBMVNIC_TSO_BUF_SZ );if (rc) {release_tx_pools (adapter);return rc;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 43/138 ARM: dts: am335x phytec boards: Fix cd-gpios active level
In reply to Greg Kroah-Hartman[ Upstream commit 8a0098c05a272c9a68f6885e09755755b612459c ]
Active level of the mmc1 cd gpio needs to be low instead of high. Fix PCM-953 and phyBOARD-WEGA.
--- arch/arm/boot/dts/am335x-pcm-953.dtsi | 2 +- arch/arm/boot/dts/am335x-wega.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/am335x-pcm-953.dtsi +1 -1
@@ -197,7 +197,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; status = "okay"; };
arch/arm/boot/dts/am335x-wega.dtsi +1 -1
@@ -157,7 +157,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; status = "okay"; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 44/138 s390/boot: disable address-of-packed-member warning
In reply to Greg Kroah-Hartman[ Upstream commit f9364df30420987e77599c4789ec0065c609a507 ]
Get rid of gcc9 warnings like this:
arch/s390/boot/ipl_report.c: In function 'find_bootdata_space':arch/s390/boot/ipl_report.c:42:26: warning: taking address of packed member of 'struct ipl_rb_components' may result in an unaligned pointer value [-Waddress-of-packed-member]
42 | for_each_rb_entry(comp, comps)
| ^~~~~
This is effectively the s390 variant of commit 20c6c1890455 ("x86/boot: Disable the address-of-packed-member compiler warning").
--- arch/s390/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/s390/Makefile +1 -0
@@ -24,6 +24,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding) +KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g) KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) UTS_MACHINE := s390x
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 45/138 RISC-V: defconfig: enable clocks, serial console
In reply to Greg Kroah-Hartman[ Upstream commit 3b025f2bc98973f181d926192b0ceb6ced0f86d2 ]
Enable PRCI clock driver and serial console by default, so the default upstream defconfig is bootable to a serial console.
--- arch/riscv/configs/defconfig | 4 ++++ 1 file changed, 4 insertions(+)
arch/riscv/configs/defconfig +4 -0
@@ -49,6 +49,8 @@ CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_EARLYCON_RISCV_SBI=y +CONFIG_SERIAL_SIFIVE=y +CONFIG_SERIAL_SIFIVE_CONSOLE=y CONFIG_HVC_RISCV_SBI=y # CONFIG_PTP_1588_CLOCK is not set CONFIG_DRM=y
@@ -64,6 +66,8 @@ CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_STORAGE=y CONFIG_USB_UAS=y CONFIG_VIRTIO_MMIO=y +CONFIG_CLK_SIFIVE=y +CONFIG_CLK_SIFIVE_FU540_PRCI=y CONFIG_SIFIVE_PLIC=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 46/138 drm/vmwgfx: Honor the sg list segment size limitation
In reply to Greg Kroah-Hartman[ Upstream commit bde15555ba61c7f664f40fd3c6fdbdb63f784c9b ]
When building sg tables, honor the device sg list segment size limitation.
--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +5 -5
@@ -454,11 +454,11 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt)if (unlikely (ret !=0 ))return ret; - ret =sg_alloc_table_from_pages (&vmw_tt->sgt, vsgt->pages, - vsgt->num_pages,0 , - (unsigned long ) - vsgt->num_pages <<PAGE_SHIFT , -GFP_KERNEL ); + ret =__sg_alloc_table_from_pages + (&vmw_tt->sgt, vsgt->pages, vsgt->num_pages,0 , + (unsigned long ) vsgt->num_pages <<PAGE_SHIFT , +dma_get_max_seg_size (dev_priv->dev->dev), +GFP_KERNEL );if (unlikely (ret !=0 )) goto out_sg_alloc_fail;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 47/138 drm/vmwgfx: fix a warning due to missing dma_parms
In reply to Greg Kroah-Hartman[ Upstream commit 39916897cd815a0ee07ba1f6820cf88a63e459fc ]
Booting up with DMA_API_DEBUG_SG=y generates a warning due to the driver forgot to set dma_parms appropriately. Set it just after vmw_dma_masks() in vmw_driver_load().
DMA-API: vmwgfx 0000:00:0f.0: mapping sg segment longer than device claims to support [len=2097152] [max=65536]
WARNING: CPU: 2 PID: 261 at kernel/dma/debug.c:1232 debug_dma_map_sg+0x360/0x480 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/13/2018 RIP: 0010:debug_dma_map_sg+0x360/0x480 Call Trace: vmw_ttm_map_dma+0x3b1/0x5b0 [vmwgfx] vmw_bo_map_dma+0x25/0x30 [vmwgfx] vmw_otables_setup+0x2a8/0x750 [vmwgfx] vmw_request_device_late+0x78/0xc0 [vmwgfx] vmw_request_device+0xee/0x4e0 [vmwgfx] vmw_driver_load.cold+0x757/0xd84 [vmwgfx] drm_dev_register+0x1ff/0x340 [drm] drm_get_pci_dev+0x110/0x290 [drm] vmw_probe+0x15/0x20 [vmwgfx] local_pci_probe+0x7a/0xc0 pci_device_probe+0x1b9/0x290 really_probe+0x1b5/0x630 driver_probe_device+0xa3/0x1a0 device_driver_attach+0x94/0xa0 __driver_attach+0xdd/0x1c0 bus_for_each_dev+0xfe/0x150 driver_attach+0x2d/0x40 bus_add_driver+0x290/0x350 driver_register+0xdc/0x1d0 __pci_register_driver+0xda/0xf0 vmwgfx_init+0x34/0x1000 [vmwgfx] do_one_initcall+0xe5/0x40a do_init_module+0x10f/0x3a0 load_module+0x16a5/0x1a40 __se_sys_finit_module+0x183/0x1c0 __x64_sys_finit_module+0x43/0x50 do_syscall_64+0xc8/0x606 entry_SYSCALL_64_after_hwframe+0x44/0xa9
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +3 -0
@@ -747,6 +747,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)if (unlikely (ret !=0 )) goto out_err0; + dma_set_max_seg_size(dev->dev, min_t(unsigned int, U32_MAX & PAGE_MASK, +SCATTERLIST_MAX_SEGMENT )); +if (dev_priv->capabilities &SVGA_CAP_GMR2 ) {DRM_INFO ("Max GMR ids is %u\n" , (unsigned )dev_priv->max_gmr_ids);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 48/138 riscv: Fix udelay in RV32.
In reply to Greg Kroah-Hartman[ Upstream commit d0e1f2110a5eeb6e410b2dd37d98bc5b30da7bc7 ]
In RV32, udelay would delay the wrong cycle. When it shifts right "UDELAY_SHIFT" bits, it either delays 0 cycle or 1 cycle. It only works correctly in RV64. Because the 'ucycles' always needs to be 64 bits variable.
--- arch/riscv/lib/delay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/lib/delay.c +1 -1
@@ -88,7 +88,7 @@ EXPORT_SYMBOL(__delay);void udelay (unsigned long usecs) { -unsigned long ucycles = usecs * lpj_fine *UDELAY_MULT ; +u64 ucycles = (u64 )usecs * lpj_fine *UDELAY_MULT ;if (unlikely (usecs >MAX_UDELAY_US )) {__delay ((u64 )usecs * riscv_timebase /1000000ULL );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 49/138 Input: imx_keypad - make sure keyboard can always wake up system
In reply to Greg Kroah-Hartman[ Upstream commit ce9a53eb3dbca89e7ad86673d94ab886e9bea704 ]
There are several scenarios that keyboard can NOT wake up system from suspend, e.g., if a keyboard is depressed between system device suspend phase and device noirq suspend phase, the keyboard ISR will be called and both keyboard depress and release interrupts will be disabled, then keyboard will no longer be able to wake up system. Another scenario would be, if a keyboard is kept depressed, and then system goes into suspend, the expected behavior would be when keyboard is released, system will be waked up, but current implementation can NOT achieve that, because both depress and release interrupts are disabled in ISR, and the event check is still in progress.
To fix these issues, need to make sure keyboard's depress or release interrupt is enabled after noirq device suspend phase, this patch moves the suspend/resume callback to noirq suspend/resume phase, and enable the corresponding interrupt according to current keyboard status.
--- drivers/input/keyboard/imx_keypad.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/input/keyboard/imx_keypad.c +14 -4
@@ -526,11 +526,12 @@ static int imx_keypad_probe(struct platform_device *pdev)return 0 ; } -static int __maybe_unused imx_kbd_suspend (struct device *dev) +static int __maybe_unused imx_kbd_noirq_suspend (struct device *dev) {struct platform_device *pdev =to_platform_device (dev);struct imx_keypad *kbd =platform_get_drvdata (pdev);struct input_dev *input_dev = kbd->input_dev; +unsigned short reg_val =readw (kbd->mmio_base +KPSR );/* imx kbd can wake up system even clock is disabled */ mutex_lock (&input_dev->mutex);
@@ -540,13 +541,20 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev)mutex_unlock (&input_dev->mutex); -if (device_may_wakeup (&pdev->dev)) +if (device_may_wakeup (&pdev->dev)) { +if (reg_val &KBD_STAT_KPKD ) + reg_val |=KBD_STAT_KRIE ; +if (reg_val &KBD_STAT_KPKR ) + reg_val |=KBD_STAT_KDIE ; +writew (reg_val, kbd->mmio_base +KPSR ); +enable_irq_wake (kbd->irq); + }return 0 ; } -static int __maybe_unused imx_kbd_resume (struct device *dev) +static int __maybe_unused imx_kbd_noirq_resume (struct device *dev) {struct platform_device *pdev =to_platform_device (dev);struct imx_keypad *kbd =platform_get_drvdata (pdev);
@@ -570,7 +578,9 @@ static int __maybe_unused imx_kbd_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +static const struct dev_pm_ops imx_kbd_pm_ops = { +SET_NOIRQ_SYSTEM_SLEEP_PM_OPS (imx_kbd_noirq_suspend, imx_kbd_noirq_resume) +};static struct platform_driver imx_keypad_driver = { .driver = {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 50/138 xdp: check device pointer before clearing
In reply to Greg Kroah-Hartman[ Upstream commit 01d76b5317003e019ace561a9b775f51aafdfdc4 ]
We should not call 'ndo_bpf()' or 'dev_put()' with NULL argument.
--- net/xdp/xdp_umem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/xdp/xdp_umem.c +6 -5
@@ -143,6 +143,9 @@ static void xdp_umem_clear_dev(struct xdp_umem *umem)struct netdev_bpf bpf;int err; +if (!umem->dev) +return ; +if (umem->zc) { bpf.command =XDP_SETUP_XSK_UMEM ; bpf.xsk.umem =NULL ;
@@ -156,11 +159,9 @@ static void xdp_umem_clear_dev(struct xdp_umem *umem)WARN (1 ,"failed to disable umem!\n" ); } -if (umem->dev) { -rtnl_lock (); -xdp_clear_umem_at_qid (umem->dev, umem->queue_id); -rtnl_unlock (); - } +rtnl_lock (); +xdp_clear_umem_at_qid (umem->dev, umem->queue_id); +rtnl_unlock ();if (umem->zc) {dev_put (umem->dev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 52/138 mlxsw: spectrum: Disallow prio-tagged packets when PVID is removed
In reply to Greg Kroah-Hartman[ Upstream commit 4b14cc313f076c37b646cee06a85f0db59cf216c ]
When PVID is removed from a bridge port, the Linux bridge drops both untagged and prio-tagged packets. Align mlxsw with this behavior.
--- drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/reg.h +1 -1
@@ -997,7 +997,7 @@ static inline void mlxsw_reg_spaft_pack(char *payload, u8 local_port,MLXSW_REG_ZERO (spaft, payload);mlxsw_reg_spaft_local_port_set (payload, local_port);mlxsw_reg_spaft_allow_untagged_set (payload, allow_untagged); -mlxsw_reg_spaft_allow_prio_tagged_set (payload, true); +mlxsw_reg_spaft_allow_prio_tagged_set (payload, allow_untagged);mlxsw_reg_spaft_allow_tagged_set (payload, true); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 53/138 KVM: nVMX: use correct clean fields when copying from eVMCS
In reply to Greg Kroah-Hartman[ Upstream commit f9bc5227652df4900eff12a9b8b38e9a8c7c78ea ]
Unfortunately, a couple of mistakes were made while implementing Enlightened VMCS support, in particular, wrong clean fields were used in copy_enlightened_to_vmcs12():
- exception_bitmap is covered by CONTROL_EXCPN;
- vm_exit_controls/pin_based_vm_exec_control/secondary_vm_exec_control are covered by CONTROL_GRP1.
--- arch/x86/kvm/vmx/nested.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/nested.c +2 -2
@@ -1404,7 +1404,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) }if (unlikely (!(evmcs->hv_clean_fields & -HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_PROC ))) { +HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_EXCPN ))) { vmcs12->exception_bitmap = evmcs->exception_bitmap; }
@@ -1444,7 +1444,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) }if (unlikely (!(evmcs->hv_clean_fields & -HV_VMX_ENLIGHTENED_CLEAN_FIELD_HOST_GRP1 ))) { +HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_GRP1 ))) { vmcs12->pin_based_vm_exec_control = evmcs->pin_based_vm_exec_control; vmcs12->vm_exit_controls = evmcs->vm_exit_controls;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 54/138 bpf: fix div64 overflow tests to properly detect errors
In reply to Greg Kroah-Hartman[ Upstream commit 3e0682695199bad51dd898fe064d1564637ff77a ]
If the result of the division is LLONG_MIN, current tests do not detect the error since the return value is truncated to a 32-bit value and ends up being 0.
--- .../testing/selftests/bpf/verifier/div_overflow.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
tools/testing/selftests/bpf/verifier/div_overflow.c +10 -4
@@ -29,8 +29,11 @@ "DIV64 overflow, check 1", .insns = {BPF_MOV64_IMM (BPF_REG_1 ,-1 ), -BPF_LD_IMM64 (BPF_REG_0 ,LLONG_MIN ), -BPF_ALU64_REG (BPF_DIV ,BPF_REG_0 ,BPF_REG_1 ), +BPF_LD_IMM64 (BPF_REG_2 ,LLONG_MIN ), +BPF_ALU64_REG (BPF_DIV ,BPF_REG_2 ,BPF_REG_1 ), +BPF_MOV32_IMM (BPF_REG_0 ,0 ), +BPF_JMP_REG (BPF_JEQ ,BPF_REG_0 ,BPF_REG_2 ,1 ), +BPF_MOV32_IMM (BPF_REG_0 ,1 ), BPF_EXIT_INSN(), }, .prog_type = BPF_PROG_TYPE_SCHED_CLS,
@@ -40,8 +43,11 @@ { "DIV64 overflow, check 2", .insns = { -BPF_LD_IMM64 (BPF_REG_0 ,LLONG_MIN ), -BPF_ALU64_IMM (BPF_DIV ,BPF_REG_0 ,-1 ), +BPF_LD_IMM64 (BPF_REG_1 ,LLONG_MIN ), +BPF_ALU64_IMM (BPF_DIV ,BPF_REG_1 ,-1 ), +BPF_MOV32_IMM (BPF_REG_0 ,0 ), +BPF_JMP_REG (BPF_JEQ ,BPF_REG_0 ,BPF_REG_1 ,1 ), +BPF_MOV32_IMM (BPF_REG_0 ,1 ), BPF_EXIT_INSN(), }, .prog_type = BPF_PROG_TYPE_SCHED_CLS,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 55/138 ARM: davinci: da850-evm: call regulator_has_full_constraints()
In reply to Greg Kroah-Hartman[ Upstream commit 0c0c9b5753cd04601b17de09da1ed2885a3b42fe ]
The BB expander at 0x21 i2c bus 1 fails to probe on da850-evm because the board doesn't set has_full_constraints to true in the regulator API.
Call regulator_has_full_constraints() at the end of board registration just like we do in da850-lcdk and da830-evm.
--- arch/arm/mach-davinci/board-da850-evm.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/board-da850-evm.c +2 -0
@@ -1479,6 +1479,8 @@ static __init void da850_evm_init(void)if (ret)pr_warn ("%s: dsp/rproc registration failed: %d\n" , __func__, ret); + +regulator_has_full_constraints (); }#ifdef CONFIG_SERIAL_8250_CONSOLE
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 29/138 netfilter: ipv6: nf_defrag: fix leakage of unqueued fragments
In reply to Greg Kroah-Hartman[ Upstream commit a0d56cb911ca301de81735f1d73c2aab424654ba ]
With commit 997dd9647164 ("net: IP6 defrag: use rbtrees in nf_conntrack_reasm.c"), nf_ct_frag6_reasm() is now called from nf_ct_frag6_queue(). With this change, nf_ct_frag6_queue() can fail after the skb has been added to the fragment queue and nf_ct_frag6_gather() was adapted to handle this case.
But nf_ct_frag6_queue() can still fail before the fragment has been queued. nf_ct_frag6_gather() can't handle this case anymore, because it has no way to know if nf_ct_frag6_queue() queued the fragment before failing. If it didn't, the skb is lost as the error code is overwritten with -EINPROGRESS.
Fix this by setting -EINPROGRESS directly in nf_ct_frag6_queue(), so that nf_ct_frag6_gather() can propagate the error as is.
--- net/ipv6/netfilter/nf_conntrack_reasm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
net/ipv6/netfilter/nf_conntrack_reasm.c +5 -7
@@ -293,7 +293,11 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb, skb->_skb_refdst =0UL ; err =nf_ct_frag6_reasm (fq, skb, prev, dev); skb->_skb_refdst = orefdst; -return err; + +/* After queue has assumed skb ownership, only 0 or +* -EINPROGRESS must be returned. +*/ +return err ? -EINPROGRESS :0 ; }skb_dst_drop (skb);
@@ -480,12 +484,6 @@ int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user) ret =0 ; } -/* after queue has assumed skb ownership, only 0 or -EINPROGRESS -* must be returned. -*/ -if (ret) - ret = -EINPROGRESS ; -spin_unlock_bh (&fq->q.lock);inet_frag_put (&fq->q);return ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 56/138 ARM: davinci: da8xx: specify dma_coherent_mask for lcdc
In reply to Greg Kroah-Hartman[ Upstream commit 68f2515bb31a664ba3e2bc1eb78dd9f529b10067 ]
The lcdc device is missing the dma_coherent_mask definition causing the following warning on da850-evm:
da8xx_lcdc da8xx_lcdc.0: found Sharp_LK043T1DG01 panel
------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at kernel/dma/mapping.c:247 dma_alloc_attrs+0xc8/0x110 Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.0-rc3-00077-g16d72dd4891f #18 Hardware name: DaVinci DA850/OMAP-L138/AM18x EVM [<c000fce8>] (unwind_backtrace) from [<c000d900>] (show_stack+0x10/0x14) [<c000d900>] (show_stack) from [<c001a4f8>] (__warn+0xec/0x114) [<c001a4f8>] (__warn) from [<c001a634>] (warn_slowpath_null+0x3c/0x48) [<c001a634>] (warn_slowpath_null) from [<c0065860>] (dma_alloc_attrs+0xc8/0x110) [<c0065860>] (dma_alloc_attrs) from [<c02820f8>] (fb_probe+0x228/0x5a8) [<c02820f8>] (fb_probe) from [<c02d3e9c>] (platform_drv_probe+0x48/0x9c) [<c02d3e9c>] (platform_drv_probe) from [<c02d221c>] (really_probe+0x1d8/0x2d4) [<c02d221c>] (really_probe) from [<c02d2474>] (driver_probe_device+0x5c/0x168) [<c02d2474>] (driver_probe_device) from [<c02d2728>] (device_driver_attach+0x58/0x60) [<c02d2728>] (device_driver_attach) from [<c02d27b0>] (__driver_attach+0x80/0xbc) [<c02d27b0>] (__driver_attach) from [<c02d047c>] (bus_for_each_dev+0x64/0xb4) [<c02d047c>] (bus_for_each_dev) from [<c02d1590>] (bus_add_driver+0xe4/0x1d8) [<c02d1590>] (bus_add_driver) from [<c02d301c>] (driver_register+0x78/0x10c) [<c02d301c>] (driver_register) from [<c000a5c0>] (do_one_initcall+0x48/0x1bc) [<c000a5c0>] (do_one_initcall) from [<c05cae6c>] (kernel_init_freeable+0x10c/0x1d8) [<c05cae6c>] (kernel_init_freeable) from [<c048a000>] (kernel_init+0x8/0xf4) [<c048a000>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34) Exception stack(0xc6837fb0 to 0xc6837ff8) 7fa0: 00000000 00000000 00000000 00000000 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 8a8073511be81dd2 ]---
Add a 32-bit mask to the platform device's definition.
--- arch/arm/mach-davinci/devices-da8xx.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-davinci/devices-da8xx.c +3 -0
@@ -686,6 +686,9 @@ static struct platform_device da8xx_lcdc_device = { .id = 0, .num_resources = ARRAY_SIZE(da8xx_lcdc_resources), .resource = da8xx_lcdc_resources, + .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + } };int __init da8xx_register_lcdc (struct da8xx_lcdc_platform_data *pdata)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 57/138 gpu: ipu-v3: image-convert: Fix input bytesperline width/height align
In reply to Greg Kroah-Hartman[ Upstream commit ff391ecd65a1b8324c49046c3db98d9c8ab29af9 ]
The output width and height alignment values were being used in the input bytesperline calculation. Fix by separating local vars w_align and h_align into w_align_in, h_align_in, w_align_out, and h_align_out.
adjustment")
--- drivers/gpu/ipu-v3/ipu-image-convert.c | 32 +++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +21 -11
@@ -1885,7 +1885,8 @@ void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out, enum ipu_rotate_mode rot_mode) {const struct ipu_image_pixfmt *infmt, *outfmt; -u32 w_align, h_align; +u32 w_align_out, h_align_out; +u32 w_align_in, h_align_in; infmt =get_format (in->pix.pixelformat); outfmt =get_format (out->pix.pixelformat);
@@ -1917,22 +1918,31 @@ void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out, }/* align input width/height */ - w_align =ilog2 (tile_width_align (IMAGE_CONVERT_IN , infmt, rot_mode)); - h_align =ilog2 (tile_height_align (IMAGE_CONVERT_IN , infmt, rot_mode)); - in->pix.width =clamp_align (in->pix.width,MIN_W ,MAX_W , w_align); - in->pix.height =clamp_align (in->pix.height,MIN_H ,MAX_H , h_align); + w_align_in =ilog2 (tile_width_align (IMAGE_CONVERT_IN , infmt, + rot_mode)); + h_align_in =ilog2 (tile_height_align (IMAGE_CONVERT_IN , infmt, + rot_mode)); + in->pix.width =clamp_align (in->pix.width,MIN_W ,MAX_W , + w_align_in); + in->pix.height =clamp_align (in->pix.height,MIN_H ,MAX_H , + h_align_in);/* align output width/height */ - w_align =ilog2 (tile_width_align (IMAGE_CONVERT_OUT , outfmt, rot_mode)); - h_align =ilog2 (tile_height_align (IMAGE_CONVERT_OUT , outfmt, rot_mode)); - out->pix.width =clamp_align (out->pix.width,MIN_W ,MAX_W , w_align); - out->pix.height =clamp_align (out->pix.height,MIN_H ,MAX_H , h_align); + w_align_out =ilog2 (tile_width_align (IMAGE_CONVERT_OUT , outfmt, + rot_mode)); + h_align_out =ilog2 (tile_height_align (IMAGE_CONVERT_OUT , outfmt, + rot_mode)); + out->pix.width =clamp_align (out->pix.width,MIN_W ,MAX_W , + w_align_out); + out->pix.height =clamp_align (out->pix.height,MIN_H ,MAX_H , + h_align_out);/* set input/output strides and image sizes */ in->pix.bytesperline = infmt->planar ? -clamp_align (in->pix.width,2 << w_align,MAX_W , w_align) : +clamp_align (in->pix.width,2 << w_align_in,MAX_W , + w_align_in) :clamp_align ((in->pix.width * infmt->bpp) >>3 , -2 << w_align,MAX_W , w_align); +2 << w_align_in,MAX_W , w_align_in); in->pix.sizeimage = infmt->planar ? (in->pix.height * in->pix.bytesperline * infmt->bpp) >>3 : in->pix.height * in->pix.bytesperline;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 58/138 gpu: ipu-v3: image-convert: Fix input bytesperline for packed formats
In reply to Greg Kroah-Hartman[ Upstream commit bca4d70cf1b8f6478a711c448a3a1e47b794b162 ]
The input bytesperline calculation for packed pixel formats was incorrect. The min/max clamping values must be multiplied by the packed bits-per-pixel. This was causing corrupted converted images when the input format was RGB4 (probably also other input packed formats).
adjustment")
--- drivers/gpu/ipu-v3/ipu-image-convert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +3 -1
@@ -1942,7 +1942,9 @@ void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out, clamp_align(in->pix.width, 2 << w_align_in, MAX_W, w_align_in) :clamp_align ((in->pix.width * infmt->bpp) >>3 , -2 << w_align_in,MAX_W , w_align_in); + ((2 << w_align_in) * infmt->bpp) >>3 , + (MAX_W * infmt->bpp) >>3 , + w_align_in); in->pix.sizeimage = infmt->planar ? (in->pix.height * in->pix.bytesperline * infmt->bpp) >>3 : in->pix.height * in->pix.bytesperline;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 60/138 mac80211: only warn once on chanctx_conf being NULL
In reply to Greg Kroah-Hartman[ Upstream commit 563572340173865a9a356e6bb02579e6998a876d ]
In multiple SSID cases, it takes time to prepare every AP interface to be ready in initializing phase. If a sta already knows everything it needs to join one of the APs and sends authentication to the AP which is not fully prepared at this point of time, AP's channel context could be NULL. As a result, warning message occurs.
Even worse, if the AP is under attack via tools such as MDK3 and massive authentication requests are received in a very short time, console will be hung due to kernel warning messages.
WARN_ON_ONCE() could be a better way for indicating warning messages without duplicate messages to flood the console.
Johannes: We still need to address the underlying problem, but we
don't really have a good handle on it yet. Suppress the worst side-effects for now.
--- net/mac80211/ieee80211_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/ieee80211_i.h +1 -1
@@ -1434,7 +1434,7 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata)rcu_read_lock (); chanctx_conf =rcu_dereference (sdata->vif.chanctx_conf); -if (WARN_ON (!chanctx_conf)) { +if (WARN_ON_ONCE (!chanctx_conf)) {rcu_read_unlock ();return NULL ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 59/138 gpu: ipu-v3: image-convert: Fix image downsize coefficients
In reply to Greg Kroah-Hartman[ Upstream commit 912bbf7e9ca422099935dd69d3ff0fd62db24882 ]
The output of the IC downsizer unit in both dimensions must be <= 1024 before being passed to the IC resizer unit. This was causing corrupted images when:
input_dim > 1024, andinput_dim / 2 < output_dim < input_dim
Some broken examples were 1920x1080 -> 1024x768 and 1920x1080 -> 1280x1080.
resize coefficients")
--- drivers/gpu/ipu-v3/ipu-image-convert.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +4 -2
@@ -409,12 +409,14 @@ static int calc_image_resize_coefficients(struct ipu_image_convert_ctx *ctx,if (WARN_ON (resized_width ==0 || resized_height ==0 ))return -EINVAL ; -while (downsized_width >= resized_width *2 ) { +while (downsized_width >1024 || + downsized_width >= resized_width *2 ) { downsized_width >>=1 ; downsize_coeff_h++; } -while (downsized_height >= resized_height *2 ) { +while (downsized_height >1024 || + downsized_height >= resized_height *2 ) { downsized_height >>=1 ; downsize_coeff_v++; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 62/138 cfg80211: util: fix bit count off by one
In reply to Greg Kroah-Hartman[ Upstream commit 1a473d6092d5d182914bea854ce0b21e6d12519d ]
The bits of Rx MCS Map in VHT capability were enumerated with index transform - index i -> (i + 1) bit => nss i. BUG!
while it should be - index i -> (i + 1) bit => (i + 1) nss.
The bug was exposed in commit a53b2a0b1245 ("iwlwifi: mvm: implement VHT extended NSS support in rs.c"), where iwlwifi started using the function.
--- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/util.c +1 -1
@@ -1989,7 +1989,7 @@ int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,continue ;if (supp >= mcs_encoding) { - max_vht_nss = i; + max_vht_nss = i +1 ;break ; } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 63/138 cfg80211: report measurement start TSF correctly
In reply to Greg Kroah-Hartman[ Upstream commit b65842025335711e2a0259feb4dbadb0c9ffb6d9 ]
Instead of reporting the AP's TSF, host time was reported. Fix it.
--- net/wireless/pmsr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/wireless/pmsr.c +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* Copyright (C) 2018 Intel Corporation +* Copyright (C) 2018 - 2019 Intel Corporation */ #ifndef __PMSR_H#define __PMSR_H
@@ -446,7 +446,7 @@ static int nl80211_pmsr_send_result(struct sk_buff *msg,if (res->ap_tsf_valid &&nla_put_u64_64bit (msg,NL80211_PMSR_RESP_ATTR_AP_TSF , - res->host_time,NL80211_PMSR_RESP_ATTR_PAD )) + res->ap_tsf,NL80211_PMSR_RESP_ATTR_PAD )) goto error;if (res->final &&nla_put_flag (msg,NL80211_PMSR_RESP_ATTR_FINAL ))
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 64/138 bpf, devmap: Fix premature entry free on destroying map
In reply to Greg Kroah-Hartman[ Upstream commit d4dd153d551634683fccf8881f606fa9f3dfa1ef ]
dev_map_free() waits for flush_needed bitmap to be empty in order to ensure all flush operations have completed before freeing its entries. However the corresponding clear_bit() was called before using the entries, so the entries could be used after free.
All access to the entries needs to be done before clearing the bit. It seems commit a5e2da6e9787 ("bpf: netdev is never null in __dev_map_flush") accidentally changed the clear_bit() and memory access order.
Note that the problem happens only in __dev_map_flush(), not in dev_map_flush_old(). dev_map_flush_old() is called only after nulling out the corresponding netdev_map entry, so dev_map_free() never frees the entry thus no such race happens there.
--- kernel/bpf/devmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/bpf/devmap.c +2 -2
@@ -291,10 +291,10 @@ void __dev_map_flush(struct bpf_map *map)if (unlikely (!dev))continue ; -__clear_bit (bit, bitmap); - bq =this_cpu_ptr (dev->bulkq);bq_xmit_all (dev, bq,XDP_XMIT_FLUSH , true); + +__clear_bit (bit, bitmap); } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 65/138 bpf, devmap: Add missing bulk queue free
In reply to Greg Kroah-Hartman[ Upstream commit edabf4d9dd905acd60048ea1579943801e3a4876 ]
dev_map_free() forgot to free bulk queue when freeing its entries.
--- kernel/bpf/devmap.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/devmap.c +1 -0
@@ -186,6 +186,7 @@ static void dev_map_free(struct bpf_map *map)if (!dev)continue ; +free_percpu (dev->bulkq);dev_put (dev->dev);kfree (dev); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 30/138 tools: bpftool: Fix JSON output when lookup fails
In reply to Greg Kroah-Hartman[ Upstream commit 1884c066579a7a274dd981a4d9639ca63db66a23 ]
In commit 9a5ab8bf1d6d ("tools: bpftool: turn err() and info() macros into functions") one case of error reporting was special cased, so it could report a lookup error for a specific key when dumping the map element. What the code forgot to do is to wrap the key and value keys into a JSON object, so an example output of pretty JSON dump of a sockhash map (which does not support looking up its values) is:
[
"key": ["0x0a","0x41","0x00","0x02","0x1f","0x78","0x00","0x00"
],
"value": {
"error": "Operation not supported"
},
"key": ["0x0a","0x41","0x00","0x02","0x1f","0x78","0x00","0x01"
],
"value": {
"error": "Operation not supported"
}]
Note the key-value pairs inside the toplevel array. They should be wrapped inside a JSON object, otherwise it is an invalid JSON. This commit fixes this, so the output now is:
[{
"key": ["0x0a","0x41","0x00","0x02","0x1f","0x78","0x00","0x00"
],
"value": {
"error": "Operation not supported"
}
},{
"key": ["0x0a","0x41","0x00","0x02","0x1f","0x78","0x00","0x01"
],
"value": {
"error": "Operation not supported"
}
}]
--- tools/bpf/bpftool/map.c | 2 ++ 1 file changed, 2 insertions(+)
tools/bpf/bpftool/map.c +2 -0
@@ -713,12 +713,14 @@ static int dump_map_elem(int fd, void *key, void *value,return 0 ;if (json_output) { +jsonw_start_object (json_wtr);jsonw_name (json_wtr,"key" );print_hex_data_json (key, map_info->key_size);jsonw_name (json_wtr,"value" );jsonw_start_object (json_wtr);jsonw_string_field (json_wtr,"error" ,strerror (lookup_errno));jsonw_end_object (json_wtr); +jsonw_end_object (json_wtr); }else {if (errno ==ENOENT )print_entry_plain (map_info, key,NULL );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 66/138 bpf, devmap: Add missing RCU read lock on flush
In reply to Greg Kroah-Hartman[ Upstream commit 86723c8640633bee4b4588d3c7784ee7a0032f65 ]
.ndo_xdp_xmit() assumes it is called under RCU. For example virtio_net uses RCU to detect it has setup the resources for tx. The assumption accidentally broke when introducing bulk queue in devmap.
--- kernel/bpf/devmap.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/bpf/devmap.c +4 -0
@@ -282,6 +282,7 @@ void __dev_map_flush(struct bpf_map *map)unsigned long *bitmap =this_cpu_ptr (dtab->flush_needed);u32 bit; +rcu_read_lock ();for_each_set_bit (bit, bitmap, map->max_entries) {struct bpf_dtab_netdev *dev =READ_ONCE (dtab->netdev_map[bit]);struct xdp_bulk_queue *bq;
@@ -297,6 +298,7 @@ void __dev_map_flush(struct bpf_map *map)__clear_bit (bit, bitmap); } +rcu_read_unlock (); }/* rcu_read_lock (from syscall and BPF contexts) ensures that if a delete and/or
@@ -389,6 +391,7 @@ static void dev_map_flush_old(struct bpf_dtab_netdev *dev)int cpu; +rcu_read_lock ();for_each_online_cpu (cpu) { bitmap =per_cpu_ptr (dev->dtab->flush_needed, cpu);__clear_bit (dev->bit, bitmap);
@@ -396,6 +399,7 @@ static void dev_map_flush_old(struct bpf_dtab_netdev *dev) bq =per_cpu_ptr (dev->bulkq, cpu);bq_xmit_all (dev, bq,XDP_XMIT_FLUSH , false); } +rcu_read_unlock (); } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 67/138 bpf, x64: fix stack layout of JITed bpf code
In reply to Greg Kroah-Hartman[ Upstream commit fe8d9571dc50232b569242fac7ea6332a654f186 ]
Since commit 177366bf7ceb the %rbp stopped pointing to %rbp of the previous stack frame. That broke frame pointer based stack unwinding. This commit is a partial revert of it.
Note that the location of tail_call_cnt is fixed, since the verifier enforces MAX_BPF_STACK stack size for programs with tail calls.
--- arch/x86/net/bpf_jit_comp.c | 74 +++++++++++-------------------------- 1 file changed, 21 insertions(+), 53 deletions(-)
arch/x86/net/bpf_jit_comp.c +21 -53
@@ -190,9 +190,7 @@ struct jit_context {#define BPF_MAX_INSN_SIZE 128#define BPF_INSN_SAFETY 64 -#define AUX_STACK_SPACE 40/* Space for RBX, R13, R14, R15, tailcnt */ - -#define PROLOGUE_SIZE 37 +#define PROLOGUE_SIZE 20/* * Emit x86-64 prologue code for BPF program and check its size.
@@ -203,44 +201,19 @@ static void emit_prologue(u8 **pprog, u32 stack_depth, bool ebpf_from_cbpf)u8 *prog = *pprog;int cnt =0 ; -/* push rbp */ -EMIT1 (0x55 ); - -/* mov rbp,rsp */ -EMIT3 (0x48 ,0x89 ,0xE5 ); - -/* sub rsp, rounded_stack_depth + AUX_STACK_SPACE */ -EMIT3_off32 (0x48 ,0x81 ,0xEC , -round_up (stack_depth,8 ) +AUX_STACK_SPACE ); - -/* sub rbp, AUX_STACK_SPACE */ -EMIT4 (0x48 ,0x83 ,0xED ,AUX_STACK_SPACE ); - -/* mov qword ptr [rbp+0],rbx */ -EMIT4 (0x48 ,0x89 ,0x5D ,0 ); -/* mov qword ptr [rbp+8],r13 */ -EMIT4 (0x4C ,0x89 ,0x6D ,8 ); -/* mov qword ptr [rbp+16],r14 */ -EMIT4 (0x4C ,0x89 ,0x75 ,16 ); -/* mov qword ptr [rbp+24],r15 */ -EMIT4 (0x4C ,0x89 ,0x7D ,24 ); - +EMIT1 (0x55 );/* push rbp */ +EMIT3 (0x48 ,0x89 ,0xE5 );/* mov rbp, rsp */ +/* sub rsp, rounded_stack_depth */ +EMIT3_off32 (0x48 ,0x81 ,0xEC ,round_up (stack_depth,8 )); +EMIT1 (0x53 );/* push rbx */ +EMIT2 (0x41 ,0x55 );/* push r13 */ +EMIT2 (0x41 ,0x56 );/* push r14 */ +EMIT2 (0x41 ,0x57 );/* push r15 */ if (!ebpf_from_cbpf) { -/* -* Clear the tail call counter (tail_call_cnt): for eBPF tail -* calls we need to reset the counter to 0. It's done in two -* instructions, resetting RAX register to 0, and moving it -* to the counter location. -*/ - -/* xor eax, eax */ -EMIT2 (0x31 ,0xc0 ); -/* mov qword ptr [rbp+32], rax */ -EMIT4 (0x48 ,0x89 ,0x45 ,32 ); - +/* zero init tail_call_cnt */ +EMIT2 (0x6a ,0x00 );BUILD_BUG_ON (cnt !=PROLOGUE_SIZE ); } - *pprog = prog; }
@@ -285,13 +258,13 @@ static void emit_bpf_tail_call(u8 **pprog)* if (tail_call_cnt > MAX_TAIL_CALL_CNT) * goto out; */ -EMIT2_off32 (0x8B ,0x85 ,36 );/* mov eax, dword ptr [rbp + 36] */ +EMIT2_off32 (0x8B ,0x85 ,-36 -MAX_BPF_STACK );/* mov eax, dword ptr [rbp - 548] */ EMIT3 (0x83 ,0xF8 ,MAX_TAIL_CALL_CNT );/* cmp eax, MAX_TAIL_CALL_CNT */ #define OFFSET2 (30 + RETPOLINE_RAX_BPF_JIT_SIZE)EMIT2 (X86_JA ,OFFSET2 );/* ja out */ label2 = cnt;EMIT3 (0x83 ,0xC0 ,0x01 );/* add eax, 1 */ -EMIT2_off32 (0x89 ,0x85 ,36 );/* mov dword ptr [rbp + 36], eax */ +EMIT2_off32 (0x89 ,0x85 ,-36 -MAX_BPF_STACK );/* mov dword ptr [rbp -548], eax */ /* prog = array->ptrs[index]; */ EMIT4_off32(0x48, 0x8B, 0x84, 0xD6, /* mov rax, [rsi + rdx * 8 + offsetof(...)] */
@@ -1040,19 +1013,14 @@ xadd: if (is_imm8(insn->off)) seen_exit = true;/* Update cleanup_addr */ ctx->cleanup_addr = proglen; -/* mov rbx, qword ptr [rbp+0] */ -EMIT4 (0x48 ,0x8B ,0x5D ,0 ); -/* mov r13, qword ptr [rbp+8] */ -EMIT4 (0x4C ,0x8B ,0x6D ,8 ); -/* mov r14, qword ptr [rbp+16] */ -EMIT4 (0x4C ,0x8B ,0x75 ,16 ); -/* mov r15, qword ptr [rbp+24] */ -EMIT4 (0x4C ,0x8B ,0x7D ,24 ); - -/* add rbp, AUX_STACK_SPACE */ -EMIT4 (0x48 ,0x83 ,0xC5 ,AUX_STACK_SPACE ); -EMIT1 (0xC9 );/* leave */ -EMIT1 (0xC3 );/* ret */ +if (!bpf_prog_was_classic (bpf_prog)) +EMIT1 (0x5B );/* get rid of tail_call_cnt */ +EMIT2 (0x41 ,0x5F );/* pop r15 */ +EMIT2 (0x41 ,0x5E );/* pop r14 */ +EMIT2 (0x41 ,0x5D );/* pop r13 */ +EMIT1 (0x5B );/* pop rbx */ +EMIT1 (0xC9 );/* leave */ +EMIT1 (0xC3 );/* ret */ break ;default :
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 68/138 qmi_wwan: add support for QMAP padding in the RX path
In reply to Greg Kroah-Hartman[ Upstream commit 61356088ace1866a847a727d4d40da7bf00b67fc ]
The QMAP code in the qmi_wwan driver is based on the CodeAurora GobiNet driver which does not process QMAP padding in the RX path correctly. Add support for QMAP padding to qmimux_rx_fixup() according to the description of the rmnet driver.
--- drivers/net/usb/qmi_wwan.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/usb/qmi_wwan.c +9 -3
@@ -153,7 +153,7 @@ static bool qmimux_has_slaves(struct usbnet *dev)static int qmimux_rx_fixup (struct usbnet *dev,struct sk_buff *skb) { -unsigned int len, offset =0 ; +unsigned int len, offset =0 , pad_len, pkt_len;struct qmimux_hdr *hdr;struct net_device *net;struct sk_buff *skbn;
@@ -171,10 +171,16 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)if (hdr->pad &0x80 ) goto skip; +/* extract padding length and check for valid length info */ + pad_len = hdr->pad &0x3f ; +if (len ==0 || pad_len >= len) + goto skip; + pkt_len = len - pad_len; + net =qmimux_find_dev (dev, hdr->mux_id);if (!net) goto skip; - skbn =netdev_alloc_skb (net, len); + skbn =netdev_alloc_skb (net, pkt_len);if (!skbn)return 0 ; skbn->dev = net;
@@ -191,7 +197,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb) goto skip; } -skb_put_data (skbn, skb->data + offset + qmimux_hdr_sz, len); +skb_put_data (skbn, skb->data + offset + qmimux_hdr_sz, pkt_len);if (netif_rx (skbn) !=NET_RX_SUCCESS )return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 69/138 qmi_wwan: avoid RCU stalls on device disconnect when in QMAP mode
In reply to Greg Kroah-Hartman[ Upstream commit a8fdde1cb830e560208af42b6c10750137f53eb3 ]
Switch qmimux_unregister_device() and qmi_wwan_disconnect() to use unregister_netdevice_queue() and unregister_netdevice_many() instead of unregister_netdevice(). This avoids RCU stalls which have been observed on device disconnect in certain setups otherwise.
--- drivers/net/usb/qmi_wwan.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/usb/qmi_wwan.c +7 -4
@@ -247,13 +247,14 @@ static int qmimux_register_device(struct net_device *real_dev, u8 mux_id)return err; } -static void qmimux_unregister_device (struct net_device *dev) +static void qmimux_unregister_device (struct net_device *dev, +struct list_head *head) {struct qmimux_priv *priv =netdev_priv (dev);struct net_device *real_dev = priv->real_dev;netdev_upper_dev_unlink (real_dev, dev); -unregister_netdevice (dev); +unregister_netdevice_queue (dev, head);/* Get rid of the reference to real_dev */ dev_put (real_dev);
@@ -424,7 +425,7 @@ static ssize_t del_mux_store(struct device *d, struct device_attribute *attr, c ret = -EINVAL ; goto err; } -qmimux_unregister_device (del_dev); +qmimux_unregister_device (del_dev,NULL );if (!qmimux_has_slaves (dev)) info->flags &= ~QMI_WWAN_FLAG_MUX ;
@@ -1434,6 +1435,7 @@ static void qmi_wwan_disconnect(struct usb_interface *intf)struct qmi_wwan_state *info;struct list_head *iter;struct net_device *ldev; +LIST_HEAD (list);/* called twice if separate control and data intf */ if (!dev)
@@ -1446,8 +1448,9 @@ static void qmi_wwan_disconnect(struct usb_interface *intf) }rcu_read_lock ();netdev_for_each_upper_dev_rcu (dev->net, ldev, iter) -qmimux_unregister_device (ldev); +qmimux_unregister_device (ldev, &list);rcu_read_unlock (); +unregister_netdevice_many (&list);rtnl_unlock (); info->flags &= ~QMI_WWAN_FLAG_MUX ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 70/138 qmi_wwan: extend permitted QMAP mux_id value range
In reply to Greg Kroah-Hartman[ Upstream commit 36815b416fa48766ac5a98e4b2dc3ebc5887222e ]
Permit mux_id values up to 254 to be used in qmimux_register_device() for compatibility with ip(8) and the rmnet driver.
--- Documentation/ABI/testing/sysfs-class-net-qmi | 4 ++-- drivers/net/usb/qmi_wwan.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Documentation/ABI/testing/sysfs-class-net-qmi +2 -2
@@ -29,7 +29,7 @@ Contact: Bjørn Mork <[email protected]> Description: Unsigned integer. - Write a number ranging from 1 to 127 to add a qmap mux + Write a number ranging from 1 to 254 to add a qmap mux based network device, supported by recent Qualcomm based modems.
@@ -46,5 +46,5 @@ Contact: Bjørn Mork <[email protected]> Description: Unsigned integer. - Write a number ranging from 1 to 127 to delete a previously + Write a number ranging from 1 to 254 to delete a previously created qmap mux based network device.
drivers/net/usb/qmi_wwan.c +2 -2
@@ -363,8 +363,8 @@ static ssize_t add_mux_store(struct device *d, struct device_attribute *attr, cif (kstrtou8 (buf,0 , &mux_id))return -EINVAL ; -/* mux_id [1 - 0x7f] range empirically found */ -if (mux_id <1 || mux_id >0x7f ) +/* mux_id [1 - 254] for compatibility with ip(8) and the rmnet driver */ +if (mux_id <1 || mux_id >254 )return -EINVAL ;if (!rtnl_trylock ())
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 71/138 mmc: core: complete HS400 before checking status
In reply to Greg Kroah-Hartman[ Upstream commit b0e370b95a3b231d0fb5d1958cce85ef57196fe6 ]
We don't have a reproducible error case, yet our BSP team suggested that the mmc_switch_status() command in mmc_select_hs400() should come after the callback into the driver completing HS400 setup. It makes sense to me because we want the status of a fully setup HS400, so it will increase the reliability of the mmc_switch_status() command.
--- drivers/mmc/core/mmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/core/mmc.c +3 -3
@@ -1212,13 +1212,13 @@ static int mmc_select_hs400(struct mmc_card *card)mmc_set_timing (host,MMC_TIMING_MMC_HS400 );mmc_set_bus_speed (card); +if (host->ops->hs400_complete) + host->ops->hs400_complete (host); + err =mmc_switch_status (card);if (err) goto out_err; -if (host->ops->hs400_complete) - host->ops->hs400_complete (host); -return 0 ; out_err:
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 72/138 IB/hfi1: Create inline to get extended headers
In reply to Greg Kroah-Hartman[ Upstream commit 9755f72496664eec70bc804104118b5797b6bf63 ]
This paves the way for another patch that reacts to a flush sdma completion for RC.
--- drivers/infiniband/hw/hfi1/hfi.h | 31 +++++++++++++++++++++++++++++++ drivers/infiniband/hw/hfi1/rc.c | 21 +-------------------- 2 files changed, 32 insertions(+), 20 deletions(-)
drivers/infiniband/hw/hfi1/hfi.h +31 -0
@@ -539,6 +539,37 @@ static inline void hfi1_16B_set_qpn(struct opa_16b_mgmt *mgmt, mgmt->src_qpn =cpu_to_be32 (src_qp &OPA_16B_MGMT_QPN_MASK ); } +/** +* hfi1_get_rc_ohdr - get extended header +* @opah - the opaheader +*/ +static inline struct ib_other_headers * +hfi1_get_rc_ohdr (struct hfi1_opa_header *opah) +{ +struct ib_other_headers *ohdr; +struct ib_header *hdr =NULL ; +struct hfi1_16b_header *hdr_16b =NULL ; + +/* Find out where the BTH is */ +if (opah->hdr_type ==HFI1_PKT_TYPE_9B ) { + hdr = &opah->ibh; +if (ib_get_lnh (hdr) ==HFI1_LRH_BTH ) + ohdr = &hdr->u.oth; +else + ohdr = &hdr->u.l.oth; + }else { +u8 l4; + + hdr_16b = &opah->opah; + l4 =hfi1_16B_get_l4 (hdr_16b); +if (l4 ==OPA_16B_L4_IB_LOCAL ) + ohdr = &hdr_16b->u.oth; +else + ohdr = &hdr_16b->u.l.oth; + } +return ohdr; +} +struct rvt_sge_state ;/*
drivers/infiniband/hw/hfi1/rc.c +1 -20
@@ -1711,8 +1711,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah)struct ib_other_headers *ohdr;struct hfi1_qp_priv *priv = qp->priv;struct rvt_swqe *wqe; -struct ib_header *hdr =NULL ; -struct hfi1_16b_header *hdr_16b =NULL ;u32 opcode, head, tail;u32 psn;struct tid_rdma_request *req;
@@ -1721,24 +1719,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah)if (!(ib_rvt_state_ops[qp->state] &RVT_SEND_OR_FLUSH_OR_RECV_OK ))return ; -/* Find out where the BTH is */ -if (priv->hdr_type ==HFI1_PKT_TYPE_9B ) { - hdr = &opah->ibh; -if (ib_get_lnh (hdr) ==HFI1_LRH_BTH ) - ohdr = &hdr->u.oth; -else - ohdr = &hdr->u.l.oth; - }else { -u8 l4; - - hdr_16b = &opah->opah; - l4 =hfi1_16B_get_l4 (hdr_16b); -if (l4 ==OPA_16B_L4_IB_LOCAL ) - ohdr = &hdr_16b->u.oth; -else - ohdr = &hdr_16b->u.l.oth; - } - + ohdr =hfi1_get_rc_ohdr (opah); opcode =ib_bth_get_opcode (ohdr); if ((opcode >= OP(RDMA_READ_RESPONSE_FIRST) && opcode <= OP(ATOMIC_ACKNOWLEDGE)) ||
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 32/138 soundwire: intel: set dai min and max channels correctly
In reply to Greg Kroah-Hartman[ Upstream commit 39194128701bf2af9bbc420ffe6e3cb5d2c16061 ]
Looks like there is a copy paste error.
This patch fixes it!
--- drivers/soundwire/intel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soundwire/intel.c +2 -2
@@ -714,8 +714,8 @@ static int intel_create_dai(struct sdw_cdns *cdns,return -ENOMEM ; } - dais[i].playback.channels_min =1 ; - dais[i].playback.channels_max = max_ch; + dais[i].capture.channels_min =1 ; + dais[i].capture.channels_max = max_ch; dais[i].capture.rates =SNDRV_PCM_RATE_48000 ; dais[i].capture.formats =SNDRV_PCM_FMTBIT_S16_LE ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 34/138 dt-bindings: can: mcp251x: add mcp25625 support
In reply to Greg Kroah-Hartman[ Upstream commit 0df82dcd55832a99363ab7f9fab954fcacdac3ae ]
Fully compatible with mcp2515, the mcp25625 have integrated transceiver.
This patch add the mcp25625 to the device tree bindings documentation.
--- Documentation/devicetree/bindings/net/can/microchip,mcp251x.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/can/microchip,mcp251x.txt +1 -0
@@ -4,6 +4,7 @@ Required properties: - compatible: Should be one of the following: - "microchip,mcp2510" for MCP2510. - "microchip,mcp2515" for MCP2515. + - "microchip,mcp25625" for MCP25625. - reg: SPI chip select. - clocks: The clock feeding the CAN controller. - interrupts: Should contain IRQ line for the CAN controller.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 33/138 netfilter: ipv6: nf_defrag: accept duplicate fragments again
In reply to Greg Kroah-Hartman[ Upstream commit 8a3dca632538c550930ce8bafa8c906b130d35cf ]
When fixing the skb leak introduced by the conversion to rbtree, I forgot about the special case of duplicate fragments. The condition under the 'insert_error' label isn't effective anymore as nf_ct_frg6_gather() doesn't override the returned value anymore. So duplicate fragments now get NF_DROP verdict.
To accept duplicate fragments again, handle them specially as soon as inet_frag_queue_insert() reports them. Return -EINPROGRESS which will translate to NF_STOLEN verdict, like any accepted fragment. However, such packets don't carry any new information and aren't queued, so we just drop them immediately.
--- net/ipv6/netfilter/nf_conntrack_reasm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
net/ipv6/netfilter/nf_conntrack_reasm.c +7 -3
@@ -265,8 +265,14 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb, prev = fq->q.fragments_tail; err =inet_frag_queue_insert (&fq->q, skb, offset, end); -if (err) +if (err) { +if (err ==IPFRAG_DUP ) { +/* No error for duplicates, pretend they got queued. */ +kfree_skb (skb); +return -EINPROGRESS ; + } goto insert_error; + }if (dev) fq->iif = dev->ifindex;
@@ -304,8 +310,6 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb,return -EINPROGRESS ; insert_error: -if (err ==IPFRAG_DUP ) - goto err;inet_frag_kill (&fq->q); err:skb_dst_drop (skb);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 35/138 can: mcp251x: add support for mcp25625
In reply to Greg Kroah-Hartman[ Upstream commit 35b7fa4d07c43ad79b88e6462119e7140eae955c ]
Fully compatible with mcp2515, the mcp25625 have integrated transceiver.
This patch adds support for the mcp25625 to the existing mcp251x driver.
--- drivers/net/can/spi/Kconfig | 5 +++-- drivers/net/can/spi/mcp251x.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/net/can/spi/Kconfig +3 -2
@@ -8,9 +8,10 @@ config CAN_HI311X Driver for the Holt HI311x SPI CAN controllers. config CAN_MCP251X - tristate "Microchip MCP251x SPI CAN controllers" + tristate "Microchip MCP251x and MCP25625 SPI CAN controllers" depends on HAS_DMA ---help--- - Driver for the Microchip MCP251x SPI CAN controllers. + Driver for the Microchip MCP251x and MCP25625 SPI CAN + controllers. endmenu
drivers/net/can/spi/mcp251x.c +16 -9
@@ -1,5 +1,5 @@/* -* CAN bus driver for Microchip 251x CAN Controller with SPI Interface +* CAN bus driver for Microchip 251x/25625 CAN Controller with SPI Interface * * MCP2510 support and bug fixes by Christian Pellegrin * <[email protected]>
@@ -41,7 +41,7 @@* static struct spi_board_info spi_board_info[] = { * { * .modalias = "mcp2510", -* // or "mcp2515" depending on your controller +* // "mcp2515" or "mcp25625" depending on your controller * .platform_data = &mcp251x_info, * .irq = IRQ_EINT13, * .max_speed_hz = 2*1000*1000,
@@ -238,6 +238,7 @@ static const struct can_bittiming_const mcp251x_bittiming_const = {enum mcp251x_model {CAN_MCP251X_MCP2510 =0x2510 ,CAN_MCP251X_MCP2515 =0x2515 , +CAN_MCP251X_MCP25625 =0x25625 , };struct mcp251x_priv {
@@ -280,7 +281,6 @@ static inline int mcp251x_is_##_model(struct spi_device *spi) \ }MCP251X_IS (2510 ); -MCP251X_IS (2515 );static void mcp251x_clean (struct net_device *net) {
@@ -639,7 +639,7 @@ static int mcp251x_hw_reset(struct spi_device *spi)/* Wait for oscillator startup timer after reset */ mdelay (MCP251X_OST_DELAY_MS ); - + reg =mcp251x_read_reg (spi,CANSTAT );if ((reg &CANCTRL_REQOP_MASK ) !=CANCTRL_REQOP_CONF )return -ENODEV ;
@@ -820,9 +820,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)/* receive buffer 0 */ if (intf &CANINTF_RX0IF ) {mcp251x_hw_rx (spi,0 ); -/* -* Free one buffer ASAP -* (The MCP2515 does this automatically.) +/* Free one buffer ASAP +* (The MCP2515/25625 does this automatically.) */ if (mcp251x_is_2510 (spi))mcp251x_write_bits (spi,CANINTF ,CANINTF_RX0IF ,0x00 );
@@ -831,7 +830,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)/* receive buffer 1 */ if (intf &CANINTF_RX1IF ) {mcp251x_hw_rx (spi,1 ); -/* the MCP2515 does this automatically */ +/* The MCP2515/25625 does this automatically. */ if (mcp251x_is_2510 (spi)) clear_intf |=CANINTF_RX1IF ; }
@@ -1006,6 +1005,10 @@ static const struct of_device_id mcp251x_of_match[] = { .compatible = "microchip,mcp2515", .data = (void *)CAN_MCP251X_MCP2515, }, + { + .compatible = "microchip,mcp25625", + .data = (void *)CAN_MCP251X_MCP25625, + }, { } };MODULE_DEVICE_TABLE (of, mcp251x_of_match);
@@ -1019,6 +1022,10 @@ static const struct spi_device_id mcp251x_id_table[] = { .name = "mcp2515", .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP2515, }, + { + .name = "mcp25625", + .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP25625, + }, { } };MODULE_DEVICE_TABLE (spi, mcp251x_id_table);
@@ -1259,5 +1266,5 @@ module_spi_driver(mcp251x_can_driver);MODULE_AUTHOR ("Chris Elston <[email protected]>, " "Christian Pellegrin <[email protected]>" ); -MODULE_DESCRIPTION ("Microchip 251x CAN driver" ); +MODULE_DESCRIPTION ("Microchip 251x/25625 CAN driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 26/138 iwlwifi: fix AX201 killer sku loading firmware issue
In reply to Greg Kroah-Hartman[ Upstream commit b17dc0632a17fbfe66b34ee7c24e1cc10cfc503e ]
When try to bring up the AX201 2 killer sku, we
run into:
[81261.392463] iwlwifi 0000:01:00.0: loaded firmware version 46.8c20f243.0 op_mode iwlmvm [81261.407407] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AX 22000, REV=0x340 [81262.424778] iwlwifi 0000:01:00.0: Collecting data: trigger 16 fired. [81262.673359] iwlwifi 0000:01:00.0: Start IWL Error Log Dump: [81262.673365] iwlwifi 0000:01:00.0: Status: 0x00000000, count: -906373681 [81262.673368] iwlwifi 0000:01:00.0: Loaded firmware version: 46.8c20f243.0 [81262.673371] iwlwifi 0000:01:00.0: 0x507C015D | ADVANCED_SYSASSERT
Fix this issue by adding 2 more cfg to avoid modifying the original cfg configuration.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +3 -1
@@ -3585,7 +3585,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, } }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) ==CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR ) && - (trans->cfg != &iwl_ax200_cfg_cc || + ((trans->cfg != &iwl_ax200_cfg_cc && + trans->cfg != &killer1650x_2ax_cfg && + trans->cfg != &killer1650w_2ax_cfg) || trans->hw_rev ==CSR_HW_REV_TYPE_QNJ_B0 )) {u32 hw_status;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 74/138 IB/hfi1: Wakeup QPs orphaned on wait list after flush
In reply to Greg Kroah-Hartman[ Upstream commit f972775b1cc0441ae22c9f8d06dd16b118463632 ]
Once an SDMA engine is taken down due to a link failure, any waiting QPs that do not have outstanding descriptors in the ring will stay on the dmawait list as long as the port is down.
Since there is no timer running, they will stay there for a long time.
The fix is to wake up all iowaits linked to dmawait. The send engine will build and post packets that get flushed back.
--- drivers/infiniband/hw/hfi1/sdma.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/infiniband/hw/hfi1/sdma.c +17 -0
@@ -405,6 +405,7 @@ static void sdma_flush(struct sdma_engine *sde)struct sdma_txreq *txp, *txp_next;LIST_HEAD (flushlist);unsigned long flags; +uint seq;/* flush from head to tail */ sdma_flush_descq (sde);
@@ -415,6 +416,22 @@ static void sdma_flush(struct sdma_engine *sde)/* flush from flush list */ list_for_each_entry_safe (txp, txp_next, &flushlist, list)complete_tx (sde, txp,SDMA_TXREQ_S_ABORTED ); +/* wakeup QPs orphaned on the dmawait list */ +do { +struct iowait *w, *nw; + + seq =read_seqbegin (&sde->waitlock); +if (!list_empty (&sde->dmawait)) { +write_seqlock (&sde->waitlock); +list_for_each_entry_safe (w, nw, &sde->dmawait, list) { +if (w->wakeup) { + w->wakeup (w,SDMA_AVAIL_REASON ); +list_del_init (&w->list); + } + } +write_sequnlock (&sde->waitlock); + } + }while (read_seqretry (&sde->waitlock, seq)); }/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 83/138 powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac
In reply to Greg Kroah-Hartman[ Upstream commit 9739ab7eda459f0669ec9807e0d9be5020bab88c ]
With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.
--- arch/powerpc/include/asm/page.h | 7 +++++++ arch/powerpc/mm/mem.c | 3 ++- arch/powerpc/platforms/powermac/Kconfig | 1 + 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +7 -0
@@ -330,6 +330,13 @@ struct vm_area_struct;#endif /* __ASSEMBLY__ */ #include <asm/slice.h> +/* +* Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks. +*/ +#ifdef CONFIG_PPC32 +#define ARCH_ZONE_DMA_BITS 30 +#else #define ARCH_ZONE_DMA_BITS 31 +#endif #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
@@ -255,7 +255,8 @@ void __init paging_init(void) (long int)((top_of_ram - total_ram) >> 20));#ifdef CONFIG_ZONE_DMA - max_zone_pfns[ZONE_DMA ] =min (max_low_pfn,0x7fffffffUL >>PAGE_SHIFT ); + max_zone_pfns[ZONE_DMA ] =min (max_low_pfn, + ((1UL <<ARCH_ZONE_DMA_BITS ) -1 ) >>PAGE_SHIFT );#endif max_zone_pfns[ZONE_NORMAL ] = max_low_pfn;#ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
@@ -7,6 +7,7 @@ config PPC_PMAC select PPC_INDIRECT_PCI if PPC32 select PPC_MPC106 if PPC32 select PPC_NATIVE + select ZONE_DMA if PPC32 default y config PPC_PMAC64
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 85/138 net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6185_g1_vtu_loadpurge()
In reply to Greg Kroah-Hartman[ Upstream commit 48620e341659f6e4b978ec229f6944dabe6df709 ]
The comment is correct, but the code ends up moving the bits four places too far, into the VTUOp field.
--- drivers/net/dsa/mv88e6xxx/global1_vtu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/mv88e6xxx/global1_vtu.c +1 -1
@@ -419,7 +419,7 @@ int mv88e6185_g1_vtu_loadpurge(struct mv88e6xxx_chip *chip,* VTU DBNum[7:4] are located in VTU Operation 11:8 */ op |= entry->fid &0x000f ; - op |= (entry->fid &0x00f0 ) <<8 ; + op |= (entry->fid &0x00f0 ) <<4 ; }return mv88e6xxx_g1_vtu_op (chip, op);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 86/138 KVM: arm/arm64: Fix emulated ptimer irq injection
In reply to Greg Kroah-Hartman[ Upstream commit e4e5a865e9a9e8e47ac1959b629e9f3ae3b062f2 ]
The emulated ptimer needs to track the level changes, otherwise the the interrupt will never get deasserted, resulting in the guest getting stuck in an interrupt storm if it enables ptimer interrupts. This was found with kvm-unit-tests; the ptimer tests hung as soon as interrupts were enabled. Typical Linux guests don't have a problem as they prefer using the virtual timer.
--- virt/kvm/arm/arch_timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
virt/kvm/arm/arch_timer.c +3 -2
@@ -321,14 +321,15 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level, } } +/* Only called for a fully emulated timer */ static void timer_emulate (struct arch_timer_context *ctx) {bool should_fire =kvm_timer_should_fire (ctx);trace_kvm_timer_emulate (ctx, should_fire); -if (should_fire) { -kvm_timer_update_irq (ctx->vcpu, true, ctx); +if (should_fire != ctx->irq.level) { +kvm_timer_update_irq (ctx->vcpu, should_fire, ctx);return ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 88/138 fscrypt: dont set policy for a dead directory
In reply to Greg Kroah-HartmanFrom: Hongjie Fang <[email protected]>
commit 5858bdad4d0d0fc18bf29f34c3ac836e0b59441f upstream.
The directory may have been removed when entering fscrypt_ioctl_set_policy(). If so, the empty_dir() check will return error for ext4 file system.
ext4_rmdir() sets i_size = 0, then ext4_empty_dir() reports an error because 'inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2)'. If the fs is mounted with errors=panic, it will trigger a panic issue.
Add the check IS_DEADDIR() to fix this problem.
--- fs/crypto/policy.c | 2 ++ 1 file changed, 2 insertions(+)
fs/crypto/policy.c +2 -0
@@ -81,6 +81,8 @@ int fscrypt_ioctl_set_policy(struct fileif (ret == -ENODATA ) {if (!S_ISDIR (inode->i_mode)) ret = -ENOTDIR ; +else if (IS_DEADDIR (inode)) + ret = -ENOENT ;else if (!inode->i_sb->s_cop->empty_dir (inode)) ret = -ENOTEMPTY ;else
Greg Kroah-Hartman
maintainerPATCH 89/138 udf: Fix incorrect final NOT_ALLOCATED (hole) extent length
In reply to Greg Kroah-HartmanFrom: Steven J. Magnani <[email protected]>
commit fa33cdbf3eceb0206a4f844fe91aeebcf6ff2b7a upstream.
In some cases, using the 'truncate' command to extend a UDF file results in a mismatch between the length of the file's extents (specifically, due to incorrect length of the final NOT_ALLOCATED extent) and the information (file) length. The discrepancy can prevent other operating systems (i.e., Windows 10) from opening the file.
Two particular errors have been observed when extending a file:
1. The final extent is larger than it should be, having been rounded up to a multiple of the block size.
B. The final extent is not shorter than it should be, due to not having
been updated when the file's information length was increased.
[JK: simplified udf_do_extend_final_block(), fixed up some types]
--- fs/udf/inode.c | 93 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 33 deletions(-)
fs/udf/inode.c +60 -33
@@ -470,13 +470,15 @@ static struct buffer_head *udf_getblk(streturn NULL ; } -/* Extend the file by 'blocks' blocks, return the number of extents added */ +/* Extend the file with new blocks totaling 'new_block_bytes', +* return the number of extents added +*/ static int udf_do_extend_file (struct inode *inode,struct extent_position *last_pos,struct kernel_long_ad *last_ext, -sector_t blocks) +loff_t new_block_bytes) { -sector_t add; +uint32_t add;int count =0 , fake = !(last_ext->extLength &UDF_EXTENT_LENGTH_MASK );struct super_block *sb = inode->i_sb;struct kernel_lb_addr prealloc_loc = {};
@@ -486,7 +488,7 @@ static int udf_do_extend_file(struct ino/* The previous extent is fake and we should not extend by anything * - there's nothing to do... */ -if (!blocks && fake) +if (!new_block_bytes && fake)return 0 ; iinfo =UDF_I (inode);
@@ -517,13 +519,12 @@ static int udf_do_extend_file(struct ino/* Can we merge with the previous extent? */ if ((last_ext->extLength &UDF_EXTENT_FLAG_MASK ) ==EXT_NOT_RECORDED_NOT_ALLOCATED ) { - add = ((1 <<30 ) - sb->s_blocksize - - (last_ext->extLength &UDF_EXTENT_LENGTH_MASK )) >> - sb->s_blocksize_bits; -if (add > blocks) - add = blocks; - blocks -= add; - last_ext->extLength += add << sb->s_blocksize_bits; + add = (1 <<30 ) - sb->s_blocksize - + (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ); +if (add > new_block_bytes) + add = new_block_bytes; + new_block_bytes -= add; + last_ext->extLength += add; }if (fake) {
@@ -544,28 +545,27 @@ static int udf_do_extend_file(struct ino }/* Managed to do everything necessary? */ -if (!blocks) +if (!new_block_bytes) goto out;/* All further extents will be NOT_RECORDED_NOT_ALLOCATED */ last_ext->extLocation.logicalBlockNum =0 ; last_ext->extLocation.partitionReferenceNum =0 ; - add = (1 << (30 -sb->s_blocksize_bits)) -1 ; - last_ext->extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | - (add << sb->s_blocksize_bits); + add = (1 <<30 ) - sb->s_blocksize; + last_ext->extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | add;/* Create enough extents to cover the whole hole */ -while (blocks > add) { - blocks -= add; +while (new_block_bytes > add) { + new_block_bytes -= add; err =udf_add_aext (inode, last_pos, &last_ext->extLocation, last_ext->extLength,1 );if (err)return err; count++; } -if (blocks) { +if (new_block_bytes) { last_ext->extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | - (blocks << sb->s_blocksize_bits); + new_block_bytes; err =udf_add_aext (inode, last_pos, &last_ext->extLocation, last_ext->extLength,1 );if (err)
@@ -596,6 +596,24 @@ out:return count; } +/* Extend the final block of the file to final_block_len bytes */ +static void udf_do_extend_final_block (struct inode *inode, +struct extent_position *last_pos, +struct kernel_long_ad *last_ext, +uint32_t final_block_len) +{ +struct super_block *sb = inode->i_sb; +uint32_t added_bytes; + + added_bytes = final_block_len - + (last_ext->extLength & (sb->s_blocksize -1 )); + last_ext->extLength += added_bytes; +UDF_I (inode)->i_lenExtents += added_bytes; + +udf_write_aext (inode, last_pos, &last_ext->extLocation, + last_ext->extLength,1 ); +} +static int udf_extend_file (struct inode *inode,loff_t newsize) {
@@ -605,10 +623,12 @@ static int udf_extend_file(struct inodeint8_t etype;struct super_block *sb = inode->i_sb;sector_t first_block = newsize >> sb->s_blocksize_bits, offset; +unsigned long partial_final_block;int adsize;struct udf_inode_info *iinfo =UDF_I (inode);struct kernel_long_ad extent; -int err; +int err =0 ; +int within_final_block;if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) adsize =sizeof (struct short_ad );
@@ -618,18 +638,8 @@ static int udf_extend_file(struct inodeBUG (); etype =inode_bmap (inode, first_block, &epos, &eloc, &elen, &offset); + within_final_block = (etype !=-1 ); -/* File has extent covering the new size (could happen when extending -* inside a block)? */ -if (etype !=-1 ) -return 0 ; -if (newsize & (sb->s_blocksize -1 )) - offset++; -/* Extended file just to the boundary of the last file block? */ -if (offset ==0 ) -return 0 ; - -/* Truncate is extending the file by 'offset' blocks */ if ((!epos.bh && epos.offset ==udf_file_entry_alloc_offset (inode)) || (epos.bh && epos.offset ==sizeof (struct allocExtDesc ))) {/* File has no extents at all or has empty last
@@ -643,7 +653,22 @@ static int udf_extend_file(struct inode &extent.extLength, 0); extent.extLength |= etype <<30 ; } - err =udf_do_extend_file (inode, &epos, &extent, offset); + + partial_final_block = newsize & (sb->s_blocksize -1 ); + +/* File has extent covering the new size (could happen when extending +* inside a block)? +*/ +if (within_final_block) { +/* Extending file within the last file block */ +udf_do_extend_final_block (inode, &epos, &extent, + partial_final_block); + }else { +loff_t add = ((loff_t )offset << sb->s_blocksize_bits) | + partial_final_block; + err =udf_do_extend_file (inode, &epos, &extent, add); + } +if (err <0 ) goto out; err =0 ;
@@ -745,6 +770,7 @@ static sector_t inode_getblk(struct inod/* Are we beyond EOF? */ if (etype ==-1 ) {int ret; +loff_t hole_len; isBeyondEOF = true;if (count) {if (c)
@@ -760,7 +786,8 @@ static sector_t inode_getblk(struct inod startnum = (offset >0 ); }/* Create extents for the hole between EOF and offset */ - ret =udf_do_extend_file (inode, &prev_epos, laarr, offset); + hole_len = (loff_t )offset << inode->i_blkbits; + ret =udf_do_extend_file (inode, &prev_epos, laarr, hole_len);if (ret <0 ) { *err = ret; newblock =0 ;
Greg Kroah-Hartman
maintainerPATCH 90/138 media: stv0297: fix frequency range limit
In reply to Greg Kroah-HartmanFrom: Mauro Carvalho Chehab <[email protected]>
commit b09a2ab2baeb36bf7ef7780405ad172281741c7c upstream.
There was a typo at the lower frequency limit for a DVB-C card, causing the driver to fail while tuning channels at the VHF range.
https://bugzilla.kernel.org/show_bug.cgi?id=202083
--- drivers/media/dvb-frontends/stv0297.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-frontends/stv0297.c +1 -1
@@ -694,7 +694,7 @@ static const struct dvb_frontend_ops stv .delsys = { SYS_DVBC_ANNEX_A }, .info = { .name = "ST STV0297 DVB-C", - .frequency_min_hz = 470 * MHz, + .frequency_min_hz = 47 * MHz, .frequency_max_hz = 862 * MHz, .frequency_stepsize_hz = 62500, .symbol_rate_min = 870000,
Greg Kroah-Hartman
maintainerPATCH 92/138 ALSA: hda/realtek - Headphone Mic cant record after S3
In reply to Greg Kroah-HartmanFrom: Kailang Yang <[email protected]>
commit d07a9a4f66e944fcc900812cbc2f6817bde6a43d upstream.
Dell headset mode platform with ALC236.
It doesn't recording after system resume from S3.
S3 mode was deep. s2idle was not has this issue.
S3 deep will cut of codec power. So, the register will back to default after resume back.
This patch will solve this issue.
--- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +1 -1
@@ -3236,6 +3236,7 @@ static void alc256_init(struct hda_codecalc_update_coefex_idx (codec,0x57 ,0x04 ,0x0007 ,0x4 );/* Hight power */ alc_update_coefex_idx (codec,0x53 ,0x02 ,0x8000 ,1 <<15 );/* Clear bit */ alc_update_coefex_idx (codec,0x53 ,0x02 ,0x8000 ,0 <<15 ); +alc_update_coef_idx (codec,0x36 ,1 <<13 ,1 <<5 );/* Switch pcbeep path to Line in path*/ }static void alc256_shutup (struct hda_codec *codec)
@@ -7782,7 +7783,6 @@ static int patch_alc269(struct hda_codec spec->shutup = alc256_shutup; spec->init_hook = alc256_init; spec->gen.mixer_nid =0 ;/* ALC256 does not have any loopback mixer path */ -alc_update_coef_idx (codec,0x36 ,1 <<13 ,1 <<5 );/* Switch pcbeep path to Line in path*/ break ;case 0x10ec0257 : spec->codec_variant =ALC269_TYPE_ALC257 ;
Greg Kroah-Hartman
maintainerPATCH 91/138 ALSA: usb-audio: Fix parse of UAC2 Extension Units
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit ca95c7bf3d29716916baccdc77c3c2284b703069 upstream.
Extension Unit (XU) is used to have a compatible layout with Processing Unit (PU) on UAC1, and the usb-audio driver code assumed it for parsing the descriptors. Meanwhile, on UAC2, XU became slightly incompatible with PU; namely, XU has a one-byte bmControls bitmap while PU has two bytes bmControls bitmap. This incompatibility results in the read of a wrong address for the last iExtension field, which ended up with an incorrect string for the mixer element name, as recently reported for Focusrite Scarlett 18i20 device.
This patch corrects this misalignment by introducing a couple of new macros and calling them depending on the descriptor type.
--- include/uapi/linux/usb/audio.h | 37 +++++++++++++++++++++++++++++++++++++ sound/usb/mixer.c | 16 ++++++++++------ 2 files changed, 47 insertions(+), 6 deletions(-)
include/uapi/linux/usb/audio.h +37 -0
@@ -450,6 +450,43 @@ static inline __u8 *uac_processing_unit_ } } +/* +* Extension Unit (XU) has almost compatible layout with Processing Unit, but +* on UAC2, it has a different bmControls size (bControlSize); it's 1 byte for +* XU while 2 bytes for PU. The last iExtension field is a one-byte index as +* well as iProcessing field of PU. +*/ +static inline __u8 uac_extension_unit_bControlSize (struct uac_processing_unit_descriptor *desc, +int protocol) +{ +switch (protocol) { +case UAC_VERSION_1 : +return desc->baSourceID[desc->bNrInPins +4 ]; +case UAC_VERSION_2 : +return 1 ;/* in UAC2, this value is constant */ +case UAC_VERSION_3 : +return 4 ;/* in UAC3, this value is constant */ +default : +return 1 ; + } +} + +static inline __u8 uac_extension_unit_iExtension (struct uac_processing_unit_descriptor *desc, +int protocol) +{ +__u8 control_size =uac_extension_unit_bControlSize (desc, protocol); + +switch (protocol) { +case UAC_VERSION_1 : +case UAC_VERSION_2 : +default : +return *(uac_processing_unit_bmControls (desc, protocol) + + control_size); +case UAC_VERSION_3 : +return 0 ;/* UAC3 does not have this field */ + } +} +/* 4.5.2 Class-Specific AS Interface Descriptor */ struct uac1_as_header_descriptor {__u8 bLength;/* in bytes: 7 */
sound/usb/mixer.c +10 -6
@@ -2318,7 +2318,7 @@ static struct procunit_info extunits[] =*/ static int build_audio_procunit (struct mixer_build *state,int unitid,void *raw_desc,struct procunit_info *list, -char *name) +bool extension_unit) {struct uac_processing_unit_descriptor *desc = raw_desc;int num_ins;
@@ -2335,6 +2335,8 @@ static int build_audio_procunit(struct mstatic struct procunit_info default_info = {0 ,NULL , default_value_info }; +const char *name = extension_unit ? +"Extension Unit" :"Processing Unit" ;if (desc->bLength <13 ) {usb_audio_err (state->chip,"invalid %s descriptor (id %d)\n" , name, unitid);
@@ -2448,7 +2450,10 @@ static int build_audio_procunit(struct m }else if (info->name) {strlcpy (kctl->id.name, info->name,sizeof (kctl->id.name)); }else { - nameid =uac_processing_unit_iProcessing (desc, state->mixer->protocol); +if (extension_unit) + nameid =uac_extension_unit_iExtension (desc, state->mixer->protocol); +else + nameid =uac_processing_unit_iProcessing (desc, state->mixer->protocol); len =0 ;if (nameid) len = snd_usb_copy_string_desc(state->chip,
@@ -2481,10 +2486,10 @@ static int parse_audio_processing_unit(scase UAC_VERSION_2 :default :return build_audio_procunit (state, unitid, raw_desc, - procunits,"Processing Unit" ); + procunits, false);case UAC_VERSION_3 :return build_audio_procunit (state, unitid, raw_desc, - uac3_procunits,"Processing Unit" ); + uac3_procunits, false); } }
@@ -2495,8 +2500,7 @@ static int parse_audio_extension_unit(st* Note that we parse extension units with processing unit descriptors. * That's ok as the layout is the same. */ -return build_audio_procunit (state, unitid, raw_desc, - extunits,"Extension Unit" ); +return build_audio_procunit (state, unitid, raw_desc, extunits, true); }/*
Greg Kroah-Hartman
maintainerPATCH 93/138 tpm: Actually fail on TPM errors during "get random"
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit 782779b60faa2fc7ff609ac8ef938260fd792c0f upstream.
A "get random" may fail with a TPM error, but those codes were returned as-is to the caller, which assumed the result was the number of bytes that had been written to the target buffer, which could lead to a kernel heap memory exposure and over-read.
This fixes tpm1_get_random() to mask positive TPM errors into -EIO, as before.
[ 18.092103] tpm tpm0: A TPM error (379) occurred attempting get random [ 18.092106] usercopy: Kernel memory exposure attempt detected from SLUB object 'kmalloc-64' (offset 0, size 379)!
--- drivers/char/tpm/tpm1-cmd.c | 7 +++++-- drivers/char/tpm/tpm2-cmd.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/char/tpm/tpm1-cmd.c +5 -2
@@ -510,7 +510,7 @@ struct tpm1_get_random_out {* * Return: * * number of bytes read -* * -errno or a TPM return code otherwise +* * -errno (positive TPM return codes are masked to -EIO) */ int tpm1_get_random (struct tpm_chip *chip,u8 *dest,size_t max) {
@@ -531,8 +531,11 @@ int tpm1_get_random(struct tpm_chip *chi rc =tpm_transmit_cmd (chip, &buf,sizeof (out->rng_data_len),"attempting get random" ); -if (rc) +if (rc) { +if (rc >0 ) + rc = -EIO ; goto out; + } out = (struct tpm1_get_random_out *)&buf.data[TPM_HEADER_SIZE ];
drivers/char/tpm/tpm2-cmd.c +5 -2
@@ -301,7 +301,7 @@ struct tpm2_get_random_out {* * Return: * size of the buffer on success, -* -errno otherwise +* -errno otherwise (positive TPM return codes are masked to -EIO) */ int tpm2_get_random (struct tpm_chip *chip,u8 *dest,size_t max) {
@@ -328,8 +328,11 @@ int tpm2_get_random(struct tpm_chip *chi offsetof(struct tpm2_get_random_out , buffer), "attempting get random"); -if (err) +if (err) { +if (err >0 ) + err = -EIO ; goto out; + } out = (struct tpm2_get_random_out *) &buf.data[TPM_HEADER_SIZE ];
Greg Kroah-Hartman
maintainerPATCH 75/138 IB/hfi1: Handle wakeup of orphaned QPs for pio
In reply to Greg Kroah-Hartman[ Upstream commit 099a884ba4c00145cef283d36e050726311c2e95 ]
Once a send context is taken down due to a link failure, any QPs waiting for pio credits will stay on the waitlist indefinitely.
Fix by wakeing up all QPs linked to piowait list.
--- drivers/infiniband/hw/hfi1/pio.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/infiniband/hw/hfi1/pio.c +16 -0
@@ -952,6 +952,22 @@ void sc_disable(struct send_context *sc) } }spin_unlock (&sc->release_lock); + +write_seqlock (&sc->waitlock); +while (!list_empty (&sc->piowait)) { +struct iowait *wait; +struct rvt_qp *qp; +struct hfi1_qp_priv *priv; + + wait = list_first_entry(&sc->piowait, struct iowait, list); + qp =iowait_to_qp (wait); + priv = qp->priv; +list_del_init (&priv->s_iowait.list); + priv->s_iowait.lock =NULL ; +hfi1_qp_wakeup (qp,RVT_S_WAIT_PIO |HFI1_S_WAIT_PIO_DRAIN ); + } +write_sequnlock (&sc->waitlock); +spin_unlock_irq (&sc->alloc_lock); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 94/138 tpm: Fix TPM 1.2 Shutdown sequence to prevent future TPM operations
In reply to Greg Kroah-HartmanFrom: Vadim Sukhomlinov <[email protected]>
commit db4d8cb9c9f2af71c4d087817160d866ed572cc9 upstream.
TPM 2.0 Shutdown involve sending TPM2_Shutdown to TPM chip and disabling future TPM operations. TPM 1.2 behavior was different, future TPM operations weren't disabled, causing rare issues. This patch ensures that future TPM operations are disabled.
--- drivers/char/tpm/tpm-chip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm-chip.c +3 -3
@@ -294,15 +294,15 @@ static int tpm_class_shutdown(struct dev { struct tpm_chip *chip = container_of(dev, struct tpm_chip, dev); +down_write (&chip->ops_sem);if (chip->flags &TPM_CHIP_FLAG_TPM2 ) { -down_write (&chip->ops_sem);if (!tpm_chip_start (chip)) {tpm2_shutdown (chip,TPM2_SU_CLEAR );tpm_chip_stop (chip); } - chip->ops =NULL ; -up_write (&chip->ops_sem); } + chip->ops =NULL ; +up_write (&chip->ops_sem);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 98/138 perf intel-pt: Fix itrace defaults for perf script intel-pt documentation
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
commit a2d8a1585e35444789c1c8cf7e2e51fb15589880 upstream.
Fix intel-pt documentation to reflect the change of itrace defaults for perf script.
--- tools/perf/Documentation/intel-pt.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/Documentation/intel-pt.txt +5 -5
@@ -88,16 +88,16 @@ smaller. To represent software control flow, "branches" samples are produced. By default a branch sample is synthesized for every single branch. To get an idea what -data is available you can use the 'perf script' tool with no parameters, which -will list all the samples. +data is available you can use the 'perf script' tool with all itrace sampling +options, which will list all the samples. perf record -e intel_pt//u ls - perf script + perf script --itrace=ibxwpe An interesting field that is not printed by default is 'flags' which can be displayed as follows: - perf script -Fcomm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr,symoff,flags + perf script --itrace=ibxwpe -F+flags The flags are "bcrosyiABEx" which stand for branch, call, return, conditional, system, asynchronous, interrupt, transaction abort, trace begin, trace end, and
@@ -713,7 +713,7 @@ Having no option is the same as which, in turn, is the same as - --itrace=ibxwpe + --itrace=cepwx The letters are:
Greg Kroah-Hartman
maintainerPATCH 99/138 perf pmu: Fix uncore PMU alias list for ARM64
In reply to Greg Kroah-HartmanFrom: John Garry <[email protected]>
commit 599ee18f0740d7661b8711249096db94c09bc508 upstream.
In commit 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 platform"), we fixed the issue of CPU events being aliased to uncore events.
Fix this same issue for ARM64, since the said commit left the (broken) behaviour untouched for ARM64.
--- tools/perf/util/pmu.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-)
tools/perf/util/pmu.c +12 -16
@@ -709,9 +709,7 @@ static void pmu_add_cpu_aliases(struct l {int i;struct pmu_events_map *map; -struct pmu_event *pe;const char *name = pmu->name; -const char *pname; map =perf_pmu__find_map (pmu);if (!map)
@@ -722,28 +720,26 @@ static void pmu_add_cpu_aliases(struct l*/ i =0 ;while (1 ) { +const char *cpu_name =is_arm_pmu_core (name) ? name :"cpu" ; +struct pmu_event *pe = &map->table[i++]; +const char *pname = pe->pmu ? pe->pmu : cpu_name; - pe = &map->table[i++];if (!pe->name) {if (pe->metric_group || pe->metric_name)continue ;break ; } -if (!is_arm_pmu_core (name)) { - pname = pe->pmu ? pe->pmu :"cpu" ; +/* +* uncore alias may be from different PMU +* with common prefix +*/ +if (pmu_is_uncore (name) && + !strncmp (pname, name,strlen (pname))) + goto new_alias; -/* -* uncore alias may be from different PMU -* with common prefix -*/ -if (pmu_is_uncore (name) && - !strncmp (pname, name,strlen (pname))) - goto new_alias; - -if (strcmp (pname, name)) -continue ; - } +if (strcmp (pname, name)) +continue ; new_alias:/* need type casts to override 'const' */
Greg Kroah-Hartman
maintainerPATCH 101/138 perf header: Assign proper ff->ph in perf_event__synthesize_features()
In reply to Greg Kroah-HartmanFrom: Song Liu <[email protected]>
commit c952b35f4b15dd1b83e952718dec3307256383ef upstream.
bpf/btf write_* functions need ff->ph->env.
With this missing, pipe-mode (perf record -o -) would crash like:
Program terminated with signal SIGSEGV, Segmentation fault.
This patch assign proper ph value to ff.
Committer testing:
(gdb) run record -o -
Starting program: /root/bin/perf record -o -
PERFILE2
<SNIP start of perf.data headers>
Thread 1 "perf" received signal SIGSEGV, Segmentation fault. __do_write_buf (size=4, buf=0x160, ff=0x7fffffff8f80) at util/header.c:126
126 memcpy(ff->buf + ff->offset, buf, size);
(gdb) bt
#0 __do_write_buf (size=4, buf=0x160, ff=0x7fffffff8f80) at util/header.c:126
#1 do_write (ff=ff@entry=0x7fffffff8f80, buf=buf@entry=0x160, size=4) at util/header.c:137
#2 0x00000000004eddba in write_bpf_prog_info (ff=0x7fffffff8f80, evlist=<optimized out>) at util/header.c:912
#3 0x00000000004f69d7 in perf_event__synthesize_features (tool=tool@entry=0x97cc00 <record>, session=session@entry=0x7fffe9c6d010,
evlist=0x7fffe9cae010, process=process@entry=0x4435d0 <process_synthesized_event>) at util/header.c:3695
#4 0x0000000000443c79 in record__synthesize (tail=tail@entry=false, rec=0x97cc00 <record>) at builtin-record.c:1214
#5 0x0000000000444ec9 in __cmd_record (rec=0x97cc00 <record>, argv=<optimized out>, argc=0) at builtin-record.c:1435
#6 cmd_record (argc=0, argv=<optimized out>) at builtin-record.c:2450
#7 0x00000000004ae3e9 in run_builtin (p=p@entry=0x98e058 <commands+216>, argc=argc@entry=3, argv=0x7fffffffd670) at perf.c:304
#8 0x000000000042eded in handle_internal_command (argv=<optimized out>, argc=<optimized out>) at perf.c:356
#9 run_argv (argcp=<optimized out>, argv=<optimized out>) at perf.c:400#10 main (argc=3, argv=<optimized out>) at perf.c:522 (gdb)
After the patch the SEGSEGV is gone.
--- tools/perf/util/header.c | 1 + 1 file changed, 1 insertion(+)
tools/perf/util/header.c +1 -0
@@ -3549,6 +3549,7 @@ int perf_event__synthesize_features(strureturn -ENOMEM ; ff.size = sz - sz_hdr; + ff.ph = &session->header;for_each_set_bit (feat, header->adds_features,HEADER_FEAT_BITS ) {if (!feat_ops[feat].synthesize) {
Greg Kroah-Hartman
maintainerPATCH 102/138 x86/ptrace: Fix possible spectre-v1 in ptrace_get_debugreg()
In reply to Greg Kroah-HartmanFrom: Dianzhang Chen <[email protected]>
commit 31a2fbb390fee4231281b939e1979e810f945415 upstream.
The index to access the threads ptrace_bps is controlled by userspace via
syscall: sys_ptrace(), hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
The index can be controlled from:
ptrace -> arch_ptrace -> ptrace_get_debugreg.
Fix this by sanitizing the user supplied index before using it access thread->ptrace_bps.
--- arch/x86/kernel/ptrace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/kernel/ptrace.c +4 -1
@@ -24,6 +24,7 @@#include <linux/rcupdate.h> #include <linux/export.h> #include <linux/context_tracking.h> +#include <linux/nospec.h> #include <linux/uaccess.h> #include <asm/pgtable.h>
@@ -642,9 +643,11 @@ static unsigned long ptrace_get_debugreg {struct thread_struct *thread = &tsk->thread;unsigned long val =0 ; +int index = n;if (n <HBP_NUM ) { -struct perf_event *bp = thread->ptrace_bps[n]; + index =array_index_nospec (index,HBP_NUM ); +struct perf_event *bp = thread->ptrace_bps[index];if (bp) val = bp->hw.info.address;
Greg Kroah-Hartman
maintainerPATCH 76/138 IB/hfi1: Handle port down properly in pio
In reply to Greg Kroah-Hartman[ Upstream commit 942a899335707fc9cfc97cb382a60734b2ff4e03 ]
The call to sc_buffer_alloc currently returns NULL (no buffer) or a buffer descriptor.
There is a third case when the port is down. Currently that returns NULL and this prevents the caller from properly handling the sc_buffer_alloc() failure. A verbs code link test after the call is racy so the indication needs to come from the state check inside the allocation routine to be valid.
Fix by encoding the ECOMM failure like SDMA. IS_ERR_OR_NULL() tests
are added at all call sites. For verbs send, this needs to treat any error by returning a completion without any MMIO copy.
--- drivers/infiniband/hw/hfi1/pio.c | 5 +++-- drivers/infiniband/hw/hfi1/rc.c | 2 +- drivers/infiniband/hw/hfi1/ud.c | 4 ++-- drivers/infiniband/hw/hfi1/verbs.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-)
drivers/infiniband/hw/hfi1/pio.c +3 -2
@@ -1443,7 +1443,8 @@ void sc_stop(struct send_context *sc, int flag)* @cb: optional callback to call when the buffer is finished sending * @arg: argument for cb * -* Return a pointer to a PIO buffer if successful, NULL if not enough room. +* Return a pointer to a PIO buffer, NULL if not enough room, -ECOMM +* when link is down. */ struct pio_buf *sc_buffer_alloc (struct send_context *sc,u32 dw_len,pio_release_cb cb,void *arg)
@@ -1459,7 +1460,7 @@ struct pio_buf *sc_buffer_alloc(struct send_context *sc, u32 dw_len,spin_lock_irqsave (&sc->alloc_lock, flags);if (!(sc->flags &SCF_ENABLED )) {spin_unlock_irqrestore (&sc->alloc_lock, flags); - goto done; +return ERR_PTR (-ECOMM ); } retry:
drivers/infiniband/hw/hfi1/rc.c +1 -1
@@ -1434,7 +1434,7 @@ void hfi1_send_rc_ack(struct hfi1_packet *packet, bool is_fecn) pbc =create_pbc (ppd, pbc_flags, qp->srate_mbps,sc_to_vlt (ppd->dd, sc5), plen); pbuf =sc_buffer_alloc (rcd->sc, plen,NULL ,NULL ); -if (!pbuf) { +if (IS_ERR_OR_NULL (pbuf)) {/* * We have no room to send at the moment. Pass * responsibility for sending the ACK to the send engine
drivers/infiniband/hw/hfi1/ud.c +2 -2
@@ -683,7 +683,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, pbc =create_pbc (ppd, pbc_flags, qp->srate_mbps, vl, plen);if (ctxt) { pbuf =sc_buffer_alloc (ctxt, plen,NULL ,NULL ); -if (pbuf) { +if (!IS_ERR_OR_NULL (pbuf)) {trace_pio_output_ibhdr (ppd->dd, &hdr, sc5); ppd->dd->pio_inline_send (ppd->dd, pbuf, pbc, &hdr, hwords);
@@ -738,7 +738,7 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, pbc =create_pbc (ppd, pbc_flags, qp->srate_mbps, vl, plen);if (ctxt) { pbuf =sc_buffer_alloc (ctxt, plen,NULL ,NULL ); -if (pbuf) { +if (!IS_ERR_OR_NULL (pbuf)) {trace_pio_output_ibhdr (ppd->dd, &hdr, sc5); ppd->dd->pio_inline_send (ppd->dd, pbuf, pbc, &hdr, hwords);
drivers/infiniband/hw/hfi1/verbs.c +2 -2
@@ -1039,10 +1039,10 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps,if (cb)iowait_pio_inc (&priv->s_iowait); pbuf =sc_buffer_alloc (sc, plen, cb, qp); -if (unlikely (!pbuf)) { +if (unlikely (IS_ERR_OR_NULL (pbuf))) {if (cb)verbs_pio_complete (qp,0 ); -if (ppd->host_link_state !=HLS_UP_ACTIVE ) { +if (IS_ERR (pbuf)) {/* * If we have filled the PIO buffers to capacity and are * not in an active state this request is not going to
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 103/138 x86/tls: Fix possible spectre-v1 in do_get_thread_area()
In reply to Greg Kroah-HartmanFrom: Dianzhang Chen <[email protected]>
commit 993773d11d45c90cb1c6481c2638c3d9f092ea5b upstream.
The index to access the threads tls array is controlled by userspace via syscall: sys_ptrace(), hence leading to a potential exploitation of the Spectre variant 1 vulnerability.
The index can be controlled from:
ptrace -> arch_ptrace -> do_get_thread_area.
Fix this by sanitizing the user supplied index before using it to access the p->thread.tls_array.
--- arch/x86/kernel/tls.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/x86/kernel/tls.c +7 -2
@@ -5,6 +5,7 @@#include <linux/user.h> #include <linux/regset.h> #include <linux/syscalls.h> +#include <linux/nospec.h> #include <linux/uaccess.h> #include <asm/desc.h>
@@ -220,6 +221,7 @@ int do_get_thread_area(struct task_struc struct user_desc __user *u_info) {struct user_desc info; +int index;if (idx ==-1 &&get_user (idx, &u_info->entry_number))return -EFAULT ;
@@ -227,8 +229,11 @@ int do_get_thread_area(struct task_strucif (idx <GDT_ENTRY_TLS_MIN || idx >GDT_ENTRY_TLS_MAX )return -EINVAL ; -fill_user_desc (&info, idx, - &p->thread.tls_array[idx -GDT_ENTRY_TLS_MIN ]); + index = idx -GDT_ENTRY_TLS_MIN ; + index =array_index_nospec (index, +GDT_ENTRY_TLS_MAX -GDT_ENTRY_TLS_MIN +1 ); + +fill_user_desc (&info, idx, &p->thread.tls_array[index]);if (copy_to_user (u_info, &info,sizeof (info)))return -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 104/138 Documentation: Add section about CPU vulnerabilities for Spectre
In reply to Greg Kroah-HartmanFrom: Tim Chen <[email protected]>
commit 6e88559470f581741bcd0f2794f9054814ac9740 upstream.
Add documentation for Spectre vulnerability and the mitigation mechanisms:
- Explain the problem and risks
- Document the mitigation mechanisms
- Document the command line controls
- Document the sysfs files
--- Documentation/admin-guide/hw-vuln/index.rst | 1 Documentation/admin-guide/hw-vuln/spectre.rst | 697 ++++++++++++++++++++++++++ Documentation/userspace-api/spec_ctrl.rst | 2 3 files changed, 700 insertions(+)
Documentation/admin-guide/hw-vuln/index.rst +1 -0
@@ -9,5 +9,6 @@ are configurable at compile, boot or run .. toctree:: :maxdepth: 1 + spectre l1tf mds
Documentation/admin-guide/hw-vuln/spectre.rst new file +697 -0
697 lines not on this page · raw message
Documentation/userspace-api/spec_ctrl.rst +2 -0
@@ -49,6 +49,8 @@ If PR_SPEC_PRCTL is set, then the per-ta available. If not set, prctl(PR_SET_SPECULATION_CTRL) for the speculation misfeature will fail. +.. _set_spec_ctrl: + PR_SET_SPECULATION_CTRL -----------------------
Greg Kroah-Hartman
maintainerPATCH 106/138 mwifiex: Abort at too short BSS descriptor element
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 685c9b7750bfacd6fc1db50d86579980593b7869 upstream.
Currently mwifiex_update_bss_desc_with_ie() implicitly assumes that the source descriptor entries contain the enough size for each type and performs copying without checking the source size. This may lead to read over boundary.
Fix this by putting the source size check in appropriate places.
--- drivers/net/wireless/marvell/mwifiex/scan.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/net/wireless/marvell/mwifiex/scan.c +15 -0
@@ -1269,6 +1269,8 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_FH_PARAMS : +if (element_len +2 <sizeof (*fh_param_set)) +return -EINVAL ; fh_param_set = (struct ieee_types_fh_param_set *) current_ptr; memcpy(&bss_entry->phy_param_set.fh_param_set,
@@ -1277,6 +1279,8 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_DS_PARAMS : +if (element_len +2 <sizeof (*ds_param_set)) +return -EINVAL ; ds_param_set = (struct ieee_types_ds_param_set *) current_ptr;
@@ -1288,6 +1292,8 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_CF_PARAMS : +if (element_len +2 <sizeof (*cf_param_set)) +return -EINVAL ; cf_param_set = (struct ieee_types_cf_param_set *) current_ptr; memcpy(&bss_entry->ss_param_set.cf_param_set,
@@ -1296,6 +1302,8 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_IBSS_PARAMS : +if (element_len +2 <sizeof (*ibss_param_set)) +return -EINVAL ; ibss_param_set = (struct ieee_types_ibss_param_set *) current_ptr;
@@ -1305,10 +1313,14 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_ERP_INFO : +if (!element_len) +return -EINVAL ; bss_entry->erp_flags = *(current_ptr +2 );break ;case WLAN_EID_PWR_CONSTRAINT : +if (!element_len) +return -EINVAL ; bss_entry->local_constraint = *(current_ptr +2 ); bss_entry->sensed_11h = true;break ;
@@ -1349,6 +1361,9 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_VENDOR_SPECIFIC : +if (element_len +2 <sizeof (vendor_ie->vend_hdr)) +return -EINVAL ; + vendor_ie = (struct ieee_types_vendor_specific *) current_ptr;
Greg Kroah-Hartman
maintainerPATCH 107/138 mwifiex: Dont abort on small, spec-compliant vendor IEs
In reply to Greg Kroah-HartmanFrom: Brian Norris <[email protected]>
commit 63d7ef36103d26f20325a921ecc96a3288560146 upstream.
Per the 802.11 specification, vendor IEs are (at minimum) only required to contain an OUI. A type field is also included in ieee80211.h (struct ieee80211_vendor_ie) but doesn't appear in the specification. The remaining fields (subtype, version) are a convention used in WMM headers.
Thus, we should not reject vendor-specific IEs that have only the minimum length (3 bytes) -- we should skip over them (since we only want to match longer IEs, that match either WMM or WPA formats). We can reject elements that don't have the minimum-required 3 byte OUI.
While we're at it, move the non-standard subtype and version fields into the WMM structs, to avoid this confusion in the future about generic "vendor header" attributes.
--- drivers/net/wireless/marvell/mwifiex/fw.h | 12 +++++++++--- drivers/net/wireless/marvell/mwifiex/scan.c | 18 +++++++++++------- drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 4 ++-- drivers/net/wireless/marvell/mwifiex/wmm.c | 2 +- 4 files changed, 23 insertions(+), 13 deletions(-)
drivers/net/wireless/marvell/mwifiex/fw.h +9 -3
@@ -1759,9 +1759,10 @@ struct mwifiex_ie_types_wmm_queue_statusstruct ieee_types_vendor_header {u8 element_id;u8 len; -u8 oui[4 ];/* 0~2: oui, 3: oui_type */ -u8 oui_subtype; -u8 version; +struct { +u8 oui[3 ]; +u8 oui_type; + } __packed oui; } __packed;struct ieee_types_wmm_parameter {
@@ -1775,6 +1776,9 @@ struct ieee_types_wmm_parameter {* Version [1] */ struct ieee_types_vendor_header vend_hdr; +u8 oui_subtype; +u8 version; +u8 qos_info_bitmap;u8 reserved;struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS ];
@@ -1792,6 +1796,8 @@ struct ieee_types_wmm_info {* Version [1] */ struct ieee_types_vendor_header vend_hdr; +u8 oui_subtype; +u8 version;u8 qos_info_bitmap; } __packed;
drivers/net/wireless/marvell/mwifiex/scan.c +11 -7
@@ -1361,21 +1361,25 @@ int mwifiex_update_bss_desc_with_ie(strubreak ;case WLAN_EID_VENDOR_SPECIFIC : -if (element_len +2 <sizeof (vendor_ie->vend_hdr)) -return -EINVAL ; - vendor_ie = (struct ieee_types_vendor_specific *) current_ptr; -if (!memcmp - (vendor_ie->vend_hdr.oui, wpa_oui, -sizeof (wpa_oui))) { +/* 802.11 requires at least 3-byte OUI. */ +if (element_len <sizeof (vendor_ie->vend_hdr.oui.oui)) +return -EINVAL ; + +/* Not long enough for a match? Skip it. */ +if (element_len <sizeof (wpa_oui)) +break ; + +if (!memcmp (&vendor_ie->vend_hdr.oui, wpa_oui, +sizeof (wpa_oui))) { bss_entry->bcn_wpa_ie = (struct ieee_types_vendor_specific *) current_ptr; bss_entry->wpa_offset = (u16) (current_ptr - bss_entry->beacon_buf); - }else if (!memcmp (vendor_ie->vend_hdr.oui, wmm_oui, + }else if (!memcmp (&vendor_ie->vend_hdr.oui, wmm_oui,sizeof (wmm_oui))) { if (total_ie_len == sizeof(struct ieee_types_wmm_parameter) ||
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c +2 -2
@@ -1351,7 +1351,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex/* Test to see if it is a WPA IE, if not, then * it is a gen IE */ -if (!memcmp (pvendor_ie->oui, wpa_oui, +if (!memcmp (&pvendor_ie->oui, wpa_oui,sizeof (wpa_oui))) {/* IE is a WPA/WPA2 IE so call set_wpa function */
@@ -1361,7 +1361,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex goto next_ie; } -if (!memcmp (pvendor_ie->oui, wps_oui, +if (!memcmp (&pvendor_ie->oui, wps_oui,sizeof (wps_oui))) {/* Test to see if it is a WPS IE, * if so, enable wps session flag
drivers/net/wireless/marvell/mwifiex/wmm.c +1 -1
@@ -240,7 +240,7 @@ mwifiex_wmm_setup_queue_priorities(strucmwifiex_dbg (priv->adapter,INFO ,"info: WMM Parameter IE: version=%d,\t" "qos_info Parameter Set Count=%d, Reserved=%#x\n" , - wmm_ie->vend_hdr.version, wmm_ie->qos_info_bitmap & + wmm_ie->version, wmm_ie->qos_info_bitmap &IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK , wmm_ie->reserved);
Greg Kroah-Hartman
maintainerPATCH 108/138 USB: serial: ftdi_sio: add ID for isodebug v1
In reply to Greg Kroah-HartmanFrom: Andreas Fritiofson <[email protected]>
commit f8377eff548170e8ea8022c067a1fbdf9e1c46a8 upstream.
This adds the vid:pid of the isodebug v1 isolated JTAG/SWD+UART. Only the second channel is available for use as a serial port.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -1029,6 +1029,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) },/* EZPrototypes devices */ { USB_DEVICE(EZPROTOTYPES_VID, HJELMSLUND_USB485_ISO_PID) }, + { USB_DEVICE_INTERFACE_NUMBER(UNJO_VID, UNJO_ISODEBUG_V1_PID, 1) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1543,3 +1543,9 @@#define CHETCO_SEASMART_DISPLAY_PID 0xA5AD/* SeaSmart NMEA2000 Display */ #define CHETCO_SEASMART_LITE_PID 0xA5AE/* SeaSmart Lite USB Adapter */ #define CHETCO_SEASMART_ANALOG_PID 0xA5AF/* SeaSmart Analog Adapter */ + +/* +* Unjo AB +*/ +#define UNJO_VID 0x22B7 +#define UNJO_ISODEBUG_V1_PID 0x150D
Greg Kroah-Hartman
maintainerPATCH 105/138 Documentation/admin: Remove the vsyscall=native documentation
In reply to Greg Kroah-HartmanFrom: Andy Lutomirski <[email protected]>
commit d974ffcfb7447db5f29a4b662a3eaf99a4e1109e upstream.
The vsyscall=native feature is gone -- remove the docs.
--- Documentation/admin-guide/kernel-parameters.txt | 6 ------ 1 file changed, 6 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +0 -6
@@ -5074,12 +5074,6 @@ emulate [default] Vsyscalls turn into traps and are emulated reasonably safely. - native Vsyscalls are native syscall instructions. - This is a little bit faster than trapping - and makes a few dynamic recompilers work - better than they would in emulation mode. - It also makes exploits much easier to write. - none Vsyscalls don't work at all. This makes them quite hard to use for exploits but might break your system.
Greg Kroah-Hartman
maintainerPATCH 109/138 USB: serial: option: add support for GosunCn ME3630 RNDIS mode
In reply to Greg Kroah-HartmanFrom: Jörgen Storvist <[email protected]>
commit aed2a26283528fb69c38e414f649411aa48fb391 upstream.
Added USB IDs for GosunCn ME3630 cellular module in RNDIS mode.
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=03 Dev#= 18 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=19d2 ProdID=0601 Rev=03.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=b950269c C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host I: If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host I: If#=0x2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
--- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/option.c +1 -0
@@ -1343,6 +1343,7 @@ static const struct usb_device_id option .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) }, + { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x0601, 0xff) }, /* GosunCn ZTE WeLink ME3630 (RNDIS mode) */ { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x0602, 0xff) }, /* GosunCn ZTE WeLink ME3630 (MBIM mode) */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), .driver_info = RSVD(4) },
Greg Kroah-Hartman
maintainerPATCH 111/138 p54usb: Fix race between disconnect and firmware loading
In reply to Greg Kroah-HartmanFrom: Alan Stern <[email protected]>
commit 6e41e2257f1094acc37618bf6c856115374c6922 upstream.
The syzbot fuzzer found a bug in the p54 USB wireless driver. The issue involves a race between disconnect and the firmware-loader callback routine, and it has several aspects.
One big problem is that when the firmware can't be loaded, the callback routine tries to unbind the driver from the USB _device_ (by calling device_release_driver) instead of from the USB _interface_ to which it is actually bound (by calling usb_driver_release_interface).
The race involves access to the private data structure. The driver's disconnect handler waits for a completion that is signalled by the firmware-loader callback routine. As soon as the completion is signalled, you have to assume that the private data structure may have been deallocated by the disconnect handler -- even if the firmware was loaded without errors. However, the callback routine does access the private data several times after that point.
Another problem is that, in order to ensure that the USB device structure hasn't been freed when the callback routine runs, the driver takes a reference to it. This isn't good enough any more, because now that the callback routine calls usb_driver_release_interface, it has to ensure that the interface structure hasn't been freed.
Finally, the driver takes an unnecessary reference to the USB device structure in the probe function and drops the reference in the disconnect handler. This extra reference doesn't accomplish anything, because the USB core already guarantees that a device structure won't be deallocated while a driver is still bound to any of its interfaces.
To fix these problems, this patch makes the following changes:
Call usb_driver_release_interface() rather than device_release_driver().
Don't signal the completion until after the important information has been copied out of the private data structure, and don't refer to the private data at all thereafter.
Lock udev (the interface's parent) before unbinding the driver instead of locking udev->parent.
During the firmware loading process, take a reference to the USB interface instead of the USB device.
Don't take an unnecessary reference to the device during probe (and then don't drop it during disconnect).
--- drivers/net/wireless/intersil/p54/p54usb.c | 43 ++++++++++++----------------- 1 file changed, 18 insertions(+), 25 deletions(-)
drivers/net/wireless/intersil/p54/p54usb.c +18 -25
@@ -33,6 +33,8 @@ MODULE_ALIAS("prism54usb");MODULE_FIRMWARE ("isl3886usb" );MODULE_FIRMWARE ("isl3887usb" ); +static struct usb_driver p54u_driver; +/* * Note: *
@@ -921,9 +923,9 @@ static void p54u_load_firmware_cb(const {struct p54u_priv *priv = context;struct usb_device *udev = priv->udev; +struct usb_interface *intf = priv->intf;int err; -complete (&priv->fw_wait_load);if (firmware) { priv->fw = firmware; err =p54u_start_ops (priv);
@@ -932,26 +934,22 @@ static void p54u_load_firmware_cb(constdev_err (&udev->dev,"Firmware not found.\n" ); } -if (err) { -struct device *parent = priv->udev->dev.parent; - -dev_err (&udev->dev,"failed to initialize device (%d)\n" , err); - -if (parent) -device_lock (parent); +complete (&priv->fw_wait_load); +/* +* At this point p54u_disconnect may have already freed +* the "priv" context. Do not use it anymore! +*/ + priv =NULL ; -device_release_driver (&udev->dev); -/* -* At this point p54u_disconnect has already freed -* the "priv" context. Do not use it anymore! -*/ - priv =NULL ; +if (err) { +dev_err (&intf->dev,"failed to initialize device (%d)\n" , err); -if (parent) -device_unlock (parent); +usb_lock_device (udev); +usb_driver_release_interface (&p54u_driver, intf); +usb_unlock_device (udev); } -usb_put_dev (udev); +usb_put_intf (intf); } static int p54u_load_firmware(struct ieee80211_hw *dev,
@@ -972,14 +970,14 @@ static int p54u_load_firmware(struct ieedev_info (&priv->udev->dev,"Loading firmware file %s\n" , p54u_fwlist[i].fw); -usb_get_dev (udev); +usb_get_intf (intf); err =request_firmware_nowait (THIS_MODULE ,1 , p54u_fwlist[i].fw, device,GFP_KERNEL , priv, p54u_load_firmware_cb);if (err) {dev_err (&priv->udev->dev,"(p54usb) cannot load firmware %s " "(%d)!\n" , p54u_fwlist[i].fw, err); -usb_put_dev (udev); +usb_put_intf (intf); }return err;
@@ -1011,8 +1009,6 @@ static int p54u_probe(struct usb_interfaskb_queue_head_init (&priv->rx_queue);init_usb_anchor (&priv->submitted); -usb_get_dev (udev); -/* really lazy and simple way of figuring out if we're a 3887 */ /* TODO: should just stick the identification in the device table */ i = intf->altsetting->desc.bNumEndpoints;
@@ -1053,10 +1049,8 @@ static int p54u_probe(struct usb_interfa priv->upload_fw = p54u_upload_firmware_net2280; } err =p54u_load_firmware (dev, intf); -if (err) { -usb_put_dev (udev); +if (err)p54_free_common (dev); - }return err; }
@@ -1072,7 +1066,6 @@ static void p54u_disconnect(struct usb_iwait_for_completion (&priv->fw_wait_load);p54_unregister_common (dev); -usb_put_dev (interface_to_usbdev (intf));release_firmware (priv->fw);p54_free_common (dev); }
Greg Kroah-Hartman
maintainerPATCH 112/138 usb: gadget: f_fs: data_len used before properly set
In reply to Greg Kroah-HartmanFrom: Fei Yang <[email protected]>
commit 4833a94eb383f5b22775077ff92ddaae90440921 upstream.
The following line of code in function ffs_epfile_io is trying to set flag io_data->use_sg in case buffer required is larger than one page.
io_data->use_sg = gadget->sg_supported && data_len > PAGE_SIZE;
However at this point of time the variable data_len has not been set to the proper buffer size yet. The consequence is that io_data->use_sg is always set regardless what buffer size really is, because the condition (data_len > PAGE_SIZE) is effectively an unsigned comparison between -EINVAL and PAGE_SIZE which would always result in TRUE.
--- drivers/usb/gadget/function/f_fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +2 -1
@@ -997,7 +997,6 @@ static ssize_t ffs_epfile_io(struct file* earlier */ gadget = epfile->ffs->gadget; - io_data->use_sg = gadget->sg_supported && data_len >PAGE_SIZE ;spin_lock_irq (&epfile->ffs->eps_lock);/* In the meantime, endpoint got disabled or changed. */
@@ -1012,6 +1011,8 @@ static ssize_t ffs_epfile_io(struct file*/ if (io_data->read) data_len =usb_ep_align_maybe (gadget, ep->ep, data_len); + + io_data->use_sg = gadget->sg_supported && data_len >PAGE_SIZE ;spin_unlock_irq (&epfile->ffs->eps_lock); data =ffs_alloc_buffer (io_data, data_len);
Greg Kroah-Hartman
maintainerPATCH 113/138 usb: gadget: ether: Fix race between gether_disconnect and rx_submit
In reply to Greg Kroah-HartmanFrom: Kiruthika Varadarajan <[email protected]>
commit d29fcf7078bc8be2b6366cbd4418265b53c94fac upstream.
On spin lock release in rx_submit, gether_disconnect get a chance to run, it makes port_usb NULL, rx_submit access NULL port USB, hence null pointer crash.
Fixed by releasing the lock in rx_submit after port_usb is used.
--- drivers/usb/gadget/function/u_ether.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/u_ether.c +4 -2
@@ -186,11 +186,12 @@ rx_submit(struct eth_dev *dev, struct us out = dev->port_usb->out_ep; else out =NULL ; -spin_unlock_irqrestore (&dev->lock, flags);if (!out) + { +spin_unlock_irqrestore (&dev->lock, flags);return -ENOTCONN ; - + }/* Padding up to RX_EXTRA handles minor disagreements with host. * Normally we use the USB "terminate on short read" convention;
@@ -214,6 +215,7 @@ rx_submit(struct eth_dev *dev, struct usif (dev->port_usb->is_fixed) size =max_t (size_t, size, dev->port_usb->fixed_out_len); +spin_unlock_irqrestore (&dev->lock, flags); skb =__netdev_alloc_skb (dev->net, size +NET_IP_ALIGN , gfp_flags);if (skb ==NULL ) {
Greg Kroah-Hartman
maintainerPATCH 114/138 usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset()
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
commit dfc4fdebc5d62ac4e2fe5428e59b273675515fb2 upstream.
Use a 10000us AHB idle timeout in dwc2_core_reset() and make it consistent with the other "wait for AHB master IDLE state" ocurrences.
This fixes a problem for me where dwc2 would not want to initialize when updating to 4.19 on a MIPS Lantiq VRX200 SoC. dwc2 worked fine with 4.14.
Testing on my board shows that it takes 180us until AHB master IDLE state is signalled. The very old vendor driver for this SoC (ifxhcd) used a 1 second timeout.
Use the same timeout that is used everywhere when polling for GRSTCTL_AHBIDLE instead of using a timeout that "works for one board" (180us in my case) to have consistent behavior across the dwc2 driver.
--- drivers/usb/dwc2/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc2/core.c +1 -1
@@ -531,7 +531,7 @@ int dwc2_core_reset(struct dwc2_hsotg *h }/* Wait for AHB master IDLE state */ -if (dwc2_hsotg_wait_bit_set (hsotg,GRSTCTL ,GRSTCTL_AHBIDLE ,50 )) { +if (dwc2_hsotg_wait_bit_set (hsotg,GRSTCTL ,GRSTCTL_AHBIDLE ,10000 )) {dev_warn (hsotg->dev,"%s: HANG! AHB Idle timeout GRSTCTL GRSTCTL_AHBIDLE\n" , __func__);return -EBUSY ;
Greg Kroah-Hartman
maintainerPATCH 115/138 usb: renesas_usbhs: add a workaround for a race condition of workqueue
In reply to Greg Kroah-HartmanFrom: Yoshihiro Shimoda <[email protected]>
commit b2357839c56ab7d06bcd4e866ebc2d0e2b7997f3 upstream.
The old commit 6e4b74e4690d ("usb: renesas: fix scheduling in atomic context bug") fixed an atomic issue by using workqueue for the shdmac dmaengine driver. However, this has a potential race condition issue between the work pending and usbhsg_ep_free_request() in gadget mode. When usbhsg_ep_free_request() is called while pending the queue, since the work_struct will be freed and then the work handler is called, kernel panic happens on process_one_work().
To fix the issue, if we could call cancel_work_sync() at somewhere before the free request, it could be easy. However,
the usbhsg_ep_free_request() is called on atomic (e.g. f_ncm driver calls free request via gether_disconnect()).
For now, almost all users are having "USB-DMAC" and the DMAengine driver can be used on atomic. So, this patch adds a workaround for a race condition to call the DMAengine APIs without the workqueue.
This means we still have TODO on shdmac environment (SH7724), but since it doesn't have SMP, the race condition might not happen.
--- drivers/usb/renesas_usbhs/fifo.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-)
drivers/usb/renesas_usbhs/fifo.c +22 -12
@@ -802,9 +802,8 @@ static int __usbhsf_dma_map_ctrl(struct }static void usbhsf_dma_complete (void *arg); -static void xfer_work (struct work_struct *work) +static void usbhsf_dma_xfer_preparing (struct usbhs_pkt *pkt) { - struct usbhs_pkt *pkt = container_of(work, struct usbhs_pkt, work);struct usbhs_pipe *pipe = pkt->pipe;struct usbhs_fifo *fifo;struct usbhs_priv *priv =usbhs_pipe_to_priv (pipe);
@@ -812,12 +811,10 @@ static void xfer_work(struct work_structstruct dma_chan *chan;struct device *dev =usbhs_priv_to_dev (priv);enum dma_transfer_direction dir; -unsigned long flags; -usbhs_lock (priv, flags); fifo =usbhs_pipe_to_fifo (pipe);if (!fifo) - goto xfer_work_end; +return ; chan =usbhsf_dma_chan_get (fifo, pkt); dir =usbhs_pipe_is_dir_in (pipe) ?DMA_DEV_TO_MEM :DMA_MEM_TO_DEV ;
@@ -826,7 +823,7 @@ static void xfer_work(struct work_struct pkt->trans, dir, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);if (!desc) - goto xfer_work_end; +return ; desc->callback = usbhsf_dma_complete; desc->callback_param = pipe;
@@ -834,7 +831,7 @@ static void xfer_work(struct work_struct pkt->cookie =dmaengine_submit (desc);if (pkt->cookie <0 ) {dev_err (dev,"Failed to submit dma descriptor\n" ); - goto xfer_work_end; +return ; } dev_dbg(dev, " %s %d (%d/ %d)\n",
@@ -845,8 +842,17 @@ static void xfer_work(struct work_structdma_async_issue_pending (chan);usbhsf_dma_start (pipe, fifo);usbhs_pipe_enable (pipe); +} + +static void xfer_work (struct work_struct *work) +{ + struct usbhs_pkt *pkt = container_of(work, struct usbhs_pkt, work); +struct usbhs_pipe *pipe = pkt->pipe; +struct usbhs_priv *priv =usbhs_pipe_to_priv (pipe); +unsigned long flags; -xfer_work_end: +usbhs_lock (priv, flags); +usbhsf_dma_xfer_preparing (pkt);usbhs_unlock (priv, flags); }
@@ -899,8 +905,13 @@ static int usbhsf_dma_prepare_push(struc pkt->trans = len;usbhsf_tx_irq_ctrl (pipe,0 ); -INIT_WORK (&pkt->work, xfer_work); -schedule_work (&pkt->work); +/* FIXME: Workaound for usb dmac that driver can be used in atomic */ +if (usbhs_get_dparam (priv, has_usb_dmac)) { +usbhsf_dma_xfer_preparing (pkt); + }else { +INIT_WORK (&pkt->work, xfer_work); +schedule_work (&pkt->work); + }return 0 ;
@@ -1006,8 +1017,7 @@ static int usbhsf_dma_prepare_pop_with_u pkt->trans = pkt->length; -INIT_WORK (&pkt->work, xfer_work); -schedule_work (&pkt->work); +usbhsf_dma_xfer_preparing (pkt);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 117/138 drivers/usb/typec/tps6598x.c: fix 4CC cmd write
In reply to Greg Kroah-HartmanFrom: Nikolaus Voss <[email protected]>
commit 2681795b5e7a5bf336537661010072f4c22cea31 upstream.
Writing 4CC commands with tps6598x_write_4cc() already has a pointer arg, don't reference it when using as arg to tps6598x_block_write(). Correcting this enforces the constness of the pointer to propagate to tps6598x_block_write(), so add the const qualifier there to avoid the warning.
--- drivers/usb/typec/tps6598x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/tps6598x.c +2 -2
@@ -127,7 +127,7 @@ tps6598x_block_read(struct tps6598x *tps }static int tps6598x_block_write (struct tps6598x *tps,u8 reg, -void *val,size_t len) +const void *val,size_t len) {u8 data[TPS_MAX_LEN +1 ];
@@ -173,7 +173,7 @@ static inline int tps6598x_write64(strucstatic inline int tps6598x_write_4cc (struct tps6598x *tps,u8 reg,const char *val) { -return tps6598x_block_write (tps, reg, &val,sizeof (u32)); +return tps6598x_block_write (tps, reg, val,4 ); }static int tps6598x_read_partner_identity (struct tps6598x *tps)
Greg Kroah-Hartman
maintainerPATCH 118/138 p54: fix crash during initialization
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
commit 1645ab931998b39aed5761f095956f0b10a6362f upstream.
This patch fixes a crash that got introduced when the mentioned patch replaced the direct list_head access with skb_peek_tail(). When the device is starting up, there are no entries in the queue, so previously to "Use skb_peek_tail() instead..." the target_skb would end up as the tail and head pointer which then could be used by __skb_queue_after to fill the empty queue.
With skb_peek_tail() in its place will instead just return NULL which then causes a crash in the __skb_queue_after().
| BUG: unable to handle kernel NULL pointer dereference at 000000 | #PF error: [normal kernel read fault] | PGD 0 P4D 0 | Oops: 0000 [#1] SMP PTI | CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: GO 5.1.0-rc7-wt+ #218 | Hardware name: MSI MS-7816/Z87-G43 (MS-7816), BIOS V1.11 05/09/2015 | Workqueue: events request_firmware_work_func | RIP: 0010:p54_tx_pending+0x10f/0x1b0 [p54common] | Code: 78 06 80 78 28 00 74 6d <48> 8b 07 49 89 7c 24 08 49 89 04 24 4 | RSP: 0018:ffffa81c81927d90 EFLAGS: 00010086 | RAX: ffff9bbaaf131048 RBX: 0000000000020670 RCX: 0000000000020264 | RDX: ffff9bbaa976d660 RSI: 0000000000000202 RDI: 0000000000000000 | RBP: ffff9bbaa976d620 R08: 00000000000006c0 R09: ffff9bbaa976d660 | R10: 0000000000000000 R11: ffffe8480dbc5900 R12: ffff9bbb45e87700 | R13: ffff9bbaa976d648 R14: ffff9bbaa976d674 R15: ffff9bbaaf131048 | FS: 0000000000000000(0000) GS:ffff9bbb5ec00000(0000) knlGS:00000 | CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 | CR2: 0000000000000000 CR3: 00000003695fc003 CR4: 00000000001606f0 | Call Trace: | p54_download_eeprom+0xbe/0x120 [p54common] | p54_read_eeprom+0x7f/0xc0 [p54common] | p54u_load_firmware_cb+0xe0/0x160 [p54usb] | request_firmware_work_func+0x42/0x80 | process_one_work+0x1f5/0x3f0 | worker_thread+0x28/0x3c0
--- drivers/net/wireless/intersil/p54/txrx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intersil/p54/txrx.c +4 -1
@@ -142,7 +142,10 @@ static int p54_assign_address(struct p54 unlikely(GET_HW_QUEUE(skb) == P54_QUEUE_BEACON)) priv->beacon_req_id = data->req_id; -__skb_queue_after (&priv->tx_queue, target_skb, skb); +if (target_skb) +__skb_queue_after (&priv->tx_queue, target_skb, skb); +else +__skb_queue_head (&priv->tx_queue, skb);spin_unlock_irqrestore (&priv->tx_queue.lock, flags);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 78/138 bnx2x: Check if transceiver implements DDM before access
In reply to Greg Kroah-Hartman[ Upstream commit cf18cecca911c0db96b868072665347efe6df46f ]
Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented.
Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message:
ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output error
Because it fails to read the additional 256 bytes in which it is assumed to exist the DDM data.
This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM data was confirmed by Mellanox as correct and similar to other Passive DACs from other manufacturers.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +2 -1
@@ -1609,7 +1609,8 @@ static int bnx2x_get_module_info(struct net_device *dev, }if (!sff8472_comp || - (diag_type &SFP_EEPROM_DIAG_ADDR_CHANGE_REQ )) { + (diag_type &SFP_EEPROM_DIAG_ADDR_CHANGE_REQ ) || + !(diag_type &SFP_EEPROM_DDM_IMPLEMENTED )) { modinfo->type =ETH_MODULE_SFF_8079 ; modinfo->eeprom_len =ETH_MODULE_SFF_8079_LEN ; }else {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +1 -0
@@ -62,6 +62,7 @@#define SFP_EEPROM_DIAG_TYPE_ADDR 0x5c#define SFP_EEPROM_DIAG_TYPE_SIZE 1#define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ (1<<2) +#define SFP_EEPROM_DDM_IMPLEMENTED (1<<6)#define SFP_EEPROM_SFF_8472_COMP_ADDR 0x5e#define SFP_EEPROM_SFF_8472_COMP_SIZE 1
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 79/138 drm: return -EFAULT if copy_to_user() fails
In reply to Greg Kroah-Hartman[ Upstream commit 74b67efa8d7b4f90137f0ab9a80dd319da050350 ]
The copy_from_user() function returns the number of bytes remaining to be copied but we want to return a negative error code. Otherwise the callers treat it as a successful copy.
--- drivers/gpu/drm/drm_bufs.c | 5 ++++- drivers/gpu/drm/drm_ioc32.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_bufs.c +4 -1
@@ -1332,7 +1332,10 @@ static int copy_one_buf(void *data, int count, struct drm_buf_entry *from) .size = from->buf_size, .low_mark = from->low_mark, .high_mark = from->high_mark}; -return copy_to_user (to, &v, offsetof(struct drm_buf_desc , flags)); + +if (copy_to_user (to, &v, offsetof(struct drm_buf_desc , flags))) +return -EFAULT ; +return 0 ; } int drm_legacy_infobufs(struct drm_device *dev, void *data,
drivers/gpu/drm/drm_ioc32.c +4 -1
@@ -372,7 +372,10 @@ static int copy_one_buf32(void *data, int count, struct drm_buf_entry *from) .size = from->buf_size, .low_mark = from->low_mark, .high_mark = from->high_mark}; -return copy_to_user (to + count, &v, offsetof(drm_buf_desc32_t , flags)); + +if (copy_to_user (to + count, &v, offsetof(drm_buf_desc32_t , flags))) +return -EFAULT ; +return 0 ; } static int drm_legacy_infobufs32(struct drm_device *dev, void *data,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 81/138 net: lio_core: fix potential sign-extension overflow on large shift
In reply to Greg Kroah-Hartman[ Upstream commit 9476274093a0e79b905f4cd6cf6d149f65e02c17 ]
Left shifting the signed int value 1 by 31 bits has undefined behaviour and the shift amount oq_no can be as much as 63. Fix this by using BIT_ULL(oq_no) instead.
Addresses-Coverity: ("Bad shift operation")
--- drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +1 -1
@@ -964,7 +964,7 @@ static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct)if (droq->ops.poll_mode) { droq->ops.napi_fn (droq); - oct_priv->napi_mask |= (1 << oq_no); + oct_priv->napi_mask |=BIT_ULL (oq_no); }else {tasklet_schedule (&oct_priv->droq_tasklet); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 82/138 scsi: qedi: Check targetname while finding boot target information
In reply to Greg Kroah-Hartman[ Upstream commit 1ac3549ed58cdfdaf43bbf31ac260e2381cc0dae ]
The kernel panic was observed during iSCSI discovery via offload with below call trace,
[ 2115.646901] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 2115.646909] IP: [<ffffffffacf7f0cc>] strncmp+0xc/0x60
[ 2115.646927] PGD 0
[ 2115.646932] Oops: 0000 [#1] SMP
[ 2115.647107] CPU: 24 PID: 264 Comm: kworker/24:1 Kdump: loaded Tainted: G
OE ------------ 3.10.0-957.el7.x86_64 #1
[ 2115.647133] Workqueue: slowpath-13:00. qed_slowpath_task [qed]
[ 2115.647135] task: ffff8d66af80b0c0 ti: ffff8d66afb80000 task.ti: ffff8d66afb80000
[ 2115.647136] RIP: 0010:[<ffffffffacf7f0cc>] [<ffffffffacf7f0cc>] strncmp+0xc/0x60
[ 2115.647141] RSP: 0018:ffff8d66afb83c68 EFLAGS: 00010206
[ 2115.647143] RAX: 0000000000000001 RBX: 0000000000000007 RCX: 000000000000000a
[ 2115.647144] RDX: 0000000000000100 RSI: 0000000000000000 RDI: ffff8d632b3ba040
[ 2115.647145] RBP: ffff8d66afb83c68 R08: 0000000000000000 R09: 000000000000ffff
[ 2115.647147] R10: 0000000000000007 R11: 0000000000000800 R12: ffff8d66a30007a0
[ 2115.647148] R13: ffff8d66747a3c10 R14: ffff8d632b3ba000 R15: ffff8d66747a32f8
[ 2115.647149] FS: 0000000000000000(0000) GS:ffff8d66aff00000(0000) knlGS:0000000000000000
[ 2115.647151] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2115.647152] CR2: 0000000000000000 CR3: 0000000509610000 CR4: 00000000007607e0
[ 2115.647153] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 2115.647154] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 2115.647155] PKRU: 00000000
[ 2115.647157] Call Trace:
[ 2115.647165] [<ffffffffc0634cc5>] qedi_get_protocol_tlv_data+0x2c5/0x510 [qedi]
[ 2115.647184] [<ffffffffc05968f5>] ? qed_mfw_process_tlv_req+0x245/0xbe0 [qed]
[ 2115.647195] [<ffffffffc05496cb>] qed_mfw_fill_tlv_data+0x4b/0xb0 [qed]
[ 2115.647206] [<ffffffffc0596911>] qed_mfw_process_tlv_req+0x261/0xbe0 [qed]
[ 2115.647215] [<ffffffffacce0e8e>] ? dequeue_task_fair+0x41e/0x660
[ 2115.647221] [<ffffffffacc2a59e>] ? __switch_to+0xce/0x580
[ 2115.647230] [<ffffffffc0546013>] qed_slowpath_task+0xa3/0x160 [qed]
[ 2115.647278] RIP [<ffffffffacf7f0cc>] strncmp+0xc/0x60Fix kernel panic by validating the session targetname before providing TLV data and confirming the presence of boot targets.
--- drivers/scsi/qedi/qedi_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/qedi/qedi_main.c +3 -0
@@ -990,6 +990,9 @@ static int qedi_find_boot_info(struct qedi_ctx *qedi,if (!iscsi_is_session_online (cls_sess))continue ; +if (!sess->targetname) +continue ; +if (pri_ctrl_flags) {if (!strcmp (pri_tgt->iscsi_name, sess->targetname) && !strcmp (pri_tgt->ip_addr, ep_ip_addr)) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 73/138 IB/hfi1: Use aborts to trigger RC throttling
In reply to Greg Kroah-Hartman[ Upstream commit 4bb02e9572af1383038d83ad196d7166c515f2ee ]
SDMA and pio flushes will cause a lot of packets to be transmitted after a link has gone down, using a lot of CPU to retransmit packets.
Fix for RC QPs by recognizing the flush status and:
- Forcing a timer start
- Putting the QP into a "send one" mode
--- drivers/infiniband/hw/hfi1/rc.c | 30 ++++++++++++++++++++++++++++++ drivers/infiniband/hw/hfi1/verbs.c | 10 ++++++---- drivers/infiniband/hw/hfi1/verbs.h | 1 + 3 files changed, 37 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/rc.c +30 -0
@@ -1703,6 +1703,36 @@ static void reset_sending_psn(struct rvt_qp *qp, u32 psn) } } +/** +* hfi1_rc_verbs_aborted - handle abort status +* @qp: the QP +* @opah: the opa header +* +* This code modifies both ACK bit in BTH[2] +* and the s_flags to go into send one mode. +* +* This serves to throttle the send engine to only +* send a single packet in the likely case the +* a link has gone down. +*/ +void hfi1_rc_verbs_aborted (struct rvt_qp *qp,struct hfi1_opa_header *opah) +{ +struct ib_other_headers *ohdr =hfi1_get_rc_ohdr (opah); +u8 opcode =ib_bth_get_opcode (ohdr); +u32 psn; + +/* ignore responses */ +if ((opcode >=OP (RDMA_READ_RESPONSE_FIRST ) && + opcode <=OP (ATOMIC_ACKNOWLEDGE )) || + opcode ==TID_OP (READ_RESP ) || + opcode ==TID_OP (WRITE_RESP )) +return ; + + psn =ib_bth_get_psn (ohdr) |IB_BTH_REQ_ACK ; + ohdr->bth[2 ] =cpu_to_be32 (psn); + qp->s_flags |=RVT_S_SEND_ONE ; +} +/* * This should be called with the QP s_lock held and interrupts disabled. */
drivers/infiniband/hw/hfi1/verbs.c +6 -4
@@ -638,6 +638,8 @@ static void verbs_sdma_complete(struct hfi1_opa_header *hdr; hdr = &tx->phdr.hdr; +if (unlikely (status ==SDMA_TXREQ_S_ABORTED )) +hfi1_rc_verbs_aborted (qp, hdr);hfi1_rc_send_complete (qp, hdr); }spin_unlock (&qp->s_lock);
@@ -1095,15 +1097,15 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps, &ps->s_txreq->phdr.hdr, ib_is_sc5(sc5)); pio_bail: +spin_lock_irqsave (&qp->s_lock, flags);if (qp->s_wqe) { -spin_lock_irqsave (&qp->s_lock, flags);rvt_send_complete (qp, qp->s_wqe, wc_status); -spin_unlock_irqrestore (&qp->s_lock, flags); }else if (qp->ibqp.qp_type ==IB_QPT_RC ) { -spin_lock_irqsave (&qp->s_lock, flags); +if (unlikely (wc_status ==IB_WC_GENERAL_ERR )) +hfi1_rc_verbs_aborted (qp, &ps->s_txreq->phdr.hdr);hfi1_rc_send_complete (qp, &ps->s_txreq->phdr.hdr); -spin_unlock_irqrestore (&qp->s_lock, flags); } +spin_unlock_irqrestore (&qp->s_lock, flags); ret =0 ;
drivers/infiniband/hw/hfi1/verbs.h +1 -0
@@ -415,6 +415,7 @@ void hfi1_rc_hdrerr(u8 ah_to_sc (struct ib_device *ibdev,struct rdma_ah_attr *ah_attr); +void hfi1_rc_verbs_aborted (struct rvt_qp *qp,struct hfi1_opa_header *opah);void hfi1_rc_send_complete (struct rvt_qp *qp,struct hfi1_opa_header *opah);void hfi1_ud_rcv (struct hfi1_packet *packet);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 130/138 staging: vchiq_2835_arm: revert "quit using custom down_interruptible()"
In reply to Greg Kroah-HartmanFrom: Nicolas Saenz Julienne <[email protected]>
commit 061ca1401f96c254e7f179bf97a1fc5c7f47e1e1 upstream.
The killable version of down() is meant to be used on situations where it should not fail at all costs, but still have the convenience of being able to kill it if really necessary. VCHIQ doesn't fit this criteria, as it's mainly used as an interface to V4L2 and ALSA devices.
--- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +1 -1
@@ -553,7 +553,7 @@ create_pagelist(char __user *buf, size_t (g_cache_line_size - 1)))) {char *fragments; -if (down_killable (&g_free_fragments_sema)) { +if (down_interruptible (&g_free_fragments_sema) !=0 ) {cleanup_pagelistinfo (pagelistinfo);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 131/138 staging: vchiq: revert "switch to wait_for_completion_killable"
In reply to Greg Kroah-HartmanFrom: Nicolas Saenz Julienne <[email protected]>
commit 086efbabdc04563268372aaef4d66039d85ee76c upstream.
The killable version of wait_for_completion() is meant to be used on situations where it should not fail at all costs, but still have the convenience of being able to kill it if really necessary. VCHIQ doesn't fit this criteria, as it's mainly used as an interface to V4L2 and ALSA devices.
--- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 21 +++++----- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 21 +++++----- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 6 +- 3 files changed, 25 insertions(+), 23 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +11 -10
@@ -560,7 +560,8 @@ add_completion(VCHIQ_INSTANCE_T instancevchiq_log_trace (vchiq_arm_log_level,"%s - completion queue full" , __func__);DEBUG_COUNT (COMPLETION_QUEUE_FULL_COUNT ); -if (wait_for_completion_killable ( &instance->remove_event)) { +if (wait_for_completion_interruptible ( + &instance->remove_event)) {vchiq_log_info (vchiq_arm_log_level,"service_callback interrupted" );return VCHIQ_RETRY ;
@@ -671,7 +672,7 @@ service_callback(VCHIQ_REASON_T reason, }DEBUG_TRACE (SERVICE_CALLBACK_LINE ); -if (wait_for_completion_killable ( +if (wait_for_completion_interruptible ( &user_service->remove_event) !=0 ) { vchiq_log_info(vchiq_arm_log_level,
@@ -1006,7 +1007,7 @@ vchiq_ioctl(struct file *file, unsignedhas been closed until the client library calls the CLOSE_DELIVERED ioctl, signalling close_event. */ if (user_service->close_pending && -wait_for_completion_killable ( +wait_for_completion_interruptible ( &user_service->close_event)) status =VCHIQ_RETRY ;break ;
@@ -1182,7 +1183,7 @@ vchiq_ioctl(struct file *file, unsignedDEBUG_TRACE (AWAIT_COMPLETION_LINE );mutex_unlock (&instance->completion_mutex); - rc =wait_for_completion_killable ( + rc =wait_for_completion_interruptible ( &instance->insert_event);mutex_lock (&instance->completion_mutex);if (rc !=0 ) {
@@ -1352,7 +1353,7 @@ vchiq_ioctl(struct file *file, unsigned do { spin_unlock(&msg_queue_spinlock); DEBUG_TRACE(DEQUEUE_MESSAGE_LINE); - if (wait_for_completion_killable( + if (wait_for_completion_interruptible( &user_service->insert_event)) { vchiq_log_info(vchiq_arm_log_level, "DEQUEUE_MESSAGE interrupted");
@@ -2360,7 +2361,7 @@ vchiq_keepalive_thread_func(void *v)while (1 ) {long rc =0 , uc =0 ; -if (wait_for_completion_killable (&arm_state->ka_evt) +if (wait_for_completion_interruptible (&arm_state->ka_evt) !=0 ) {vchiq_log_error (vchiq_susp_log_level,"%s interrupted" , __func__);
@@ -2611,7 +2612,7 @@ block_resume(struct vchiq_arm_state *armwrite_unlock_bh (&arm_state->susp_res_lock);vchiq_log_info (vchiq_susp_log_level,"%s wait for previously " "blocked clients" , __func__); -if (wait_for_completion_killable_timeout ( +if (wait_for_completion_interruptible_timeout ( &arm_state->blocked_blocker, timeout_val) <=0 ) { vchiq_log_error(vchiq_susp_log_level, "%s wait for "
@@ -2637,7 +2638,7 @@ block_resume(struct vchiq_arm_state *armwrite_unlock_bh (&arm_state->susp_res_lock);vchiq_log_info (vchiq_susp_log_level,"%s wait for resume" , __func__); -if (wait_for_completion_killable_timeout ( +if (wait_for_completion_interruptible_timeout ( &arm_state->vc_resume_complete, timeout_val) <=0 ) { vchiq_log_error(vchiq_susp_log_level, "%s wait for "
@@ -2844,7 +2845,7 @@ vchiq_arm_force_suspend(struct vchiq_sta do { write_unlock_bh(&arm_state->susp_res_lock); - rc = wait_for_completion_killable_timeout( + rc = wait_for_completion_interruptible_timeout( &arm_state->vc_suspend_complete, msecs_to_jiffies(FORCE_SUSPEND_TIMEOUT_MS));
@@ -2940,7 +2941,7 @@ vchiq_arm_allow_resume(struct vchiq_statwrite_unlock_bh (&arm_state->susp_res_lock);if (resume) { -if (wait_for_completion_killable ( +if (wait_for_completion_interruptible ( &arm_state->vc_resume_complete) <0 ) {vchiq_log_error (vchiq_susp_log_level,"%s interrupted" , __func__);
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +11 -10
@@ -590,7 +590,7 @@ reserve_space(struct vchiq_state *state,remote_event_signal (&state->remote->trigger);if (!is_blocking || - (wait_for_completion_killable ( + (wait_for_completion_interruptible ( &state->slot_available_event)))return NULL ;/* No space available */ }
@@ -860,7 +860,7 @@ queue_message(struct vchiq_state *state,spin_unlock ("a_spinlock);mutex_unlock (&state->slot_mutex); -if (wait_for_completion_killable ( +if (wait_for_completion_interruptible ( &state->data_quota_event))return VCHIQ_RETRY ;
@@ -891,7 +891,7 @@ queue_message(struct vchiq_state *state, service_quota->slot_use_count);VCHIQ_SERVICE_STATS_INC (service, quota_stalls);mutex_unlock (&state->slot_mutex); -if (wait_for_completion_killable ( +if (wait_for_completion_interruptible ( &service_quota->quota_event))return VCHIQ_RETRY ;if (service->closing)
@@ -1740,7 +1740,8 @@ parse_rx_slots(struct vchiq_state *state &service->bulk_rx : &service->bulk_tx;DEBUG_TRACE (PARSE_LINE ); -if (mutex_lock_killable (&service->bulk_mutex)) { +if (mutex_lock_killable ( + &service->bulk_mutex) !=0 ) {DEBUG_TRACE (PARSE_LINE ); goto bail_not_ready; }
@@ -2458,7 +2459,7 @@ vchiq_open_service_internal(struct vchiq QMFLAGS_IS_BLOCKING);if (status ==VCHIQ_SUCCESS ) {/* Wait for the ACK/NAK */ -if (wait_for_completion_killable (&service->remove_event)) { +if (wait_for_completion_interruptible (&service->remove_event)) { status =VCHIQ_RETRY ;vchiq_release_service_internal (service); } else if ((service->srvstate != VCHIQ_SRVSTATE_OPEN) &&
@@ -2825,7 +2826,7 @@ vchiq_connect_internal(struct vchiq_stat }if (state->conn_state ==VCHIQ_CONNSTATE_CONNECTING ) { -if (wait_for_completion_killable (&state->connect)) +if (wait_for_completion_interruptible (&state->connect))return VCHIQ_RETRY ;vchiq_set_conn_state (state,VCHIQ_CONNSTATE_CONNECTED );
@@ -2924,7 +2925,7 @@ vchiq_close_service(VCHIQ_SERVICE_HANDLE }while (1 ) { -if (wait_for_completion_killable (&service->remove_event)) { +if (wait_for_completion_interruptible (&service->remove_event)) { status =VCHIQ_RETRY ;break ; }
@@ -2985,7 +2986,7 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDLrequest_poll (service->state, service,VCHIQ_POLL_REMOVE ); }while (1 ) { -if (wait_for_completion_killable (&service->remove_event)) { +if (wait_for_completion_interruptible (&service->remove_event)) { status =VCHIQ_RETRY ;break ; }
@@ -3068,7 +3069,7 @@ VCHIQ_STATUS_T vchiq_bulk_transfer(VCHIQVCHIQ_SERVICE_STATS_INC (service, bulk_stalls); do { mutex_unlock(&service->bulk_mutex); - if (wait_for_completion_killable( + if (wait_for_completion_interruptible( &service->bulk_remove_event)) { status = VCHIQ_RETRY; goto error_exit;
@@ -3145,7 +3146,7 @@ waiting:if (bulk_waiter) { bulk_waiter->bulk = bulk; -if (wait_for_completion_killable (&bulk_waiter->event)) +if (wait_for_completion_interruptible (&bulk_waiter->event)) status =VCHIQ_RETRY ;else if (bulk_waiter->actual ==VCHIQ_BULK_ACTUAL_ABORTED ) status =VCHIQ_ERROR ;
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c +3 -3
@@ -80,7 +80,7 @@ void vchiu_queue_push(struct vchiu_queuereturn ;while (queue->write == queue->read + queue->size) { -if (wait_for_completion_killable (&queue->pop)) +if (wait_for_completion_interruptible (&queue->pop))flush_signals (current); }
@@ -93,7 +93,7 @@ void vchiu_queue_push(struct vchiu_queuestruct vchiq_header *vchiu_queue_peek (struct vchiu_queue *queue) {while (queue->write == queue->read) { -if (wait_for_completion_killable (&queue->push)) +if (wait_for_completion_interruptible (&queue->push))flush_signals (current); }
@@ -107,7 +107,7 @@ struct vchiq_header *vchiu_queue_pop(strstruct vchiq_header *header;while (queue->write == queue->read) { -if (wait_for_completion_killable (&queue->push)) +if (wait_for_completion_interruptible (&queue->push))flush_signals (current); }
Greg Kroah-Hartman
maintainerPATCH 132/138 staging: vchiq: make wait events interruptible
In reply to Greg Kroah-HartmanFrom: Nicolas Saenz Julienne <[email protected]>
commit 77cf3f5dcf35c8f547f075213dbc15146d44cc76 upstream.
The killable version of wait_event() is meant to be used on situations where it should not fail at all costs, but still have the convenience of being able to kill it if really necessary. Wait events in VCHIQ doesn't fit this criteria, as it's mainly used as an interface to V4L2 and ALSA devices.
--- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +9 -1
@@ -425,13 +425,21 @@ remote_event_create(wait_queue_head_t *winit_waitqueue_head (wq); } +/* +* All the event waiting routines in VCHIQ used a custom semaphore +* implementation that filtered most signals. This achieved a behaviour similar +* to the "killable" family of functions. While cleaning up this code all the +* routines where switched to the "interruptible" family of functions, as the +* former was deemed unjustified and the use "killable" set all VCHIQ's +* threads in D state. +*/ static inline int remote_event_wait (wait_queue_head_t *wq,struct remote_event *event) {if (!event->fired) { event->armed =1 ;dsb (sy); -if (wait_event_killable (*wq, event->fired)) { +if (wait_event_interruptible (*wq, event->fired)) { event->armed =0 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 133/138 staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
commit 5555ebbbac822b4fa28db2be15aaf98b3c21af26 upstream.
In the default event case switchdev_work is being leaked because nothing is queued for work. Fix this by kfree'ing switchdev_work before returning NOTIFY_DONE.
Addresses-Coverity: ("Resource leak")
--- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/fsl-dpaa2/ethsw/ethsw.c +1 -0
@@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct ndev_hold (dev);break ;default : +kfree (switchdev_work);return NOTIFY_DONE ; }
Greg Kroah-Hartman
maintainerPATCH 134/138 staging: bcm2835-camera: Replace spinlock protecting context_map with mutex
In reply to Greg Kroah-HartmanFrom: Dave Stevenson <[email protected]>
commit 8dedab2903f152aa3cee9ae3d57c828dea0d356e upstream.
The commit "staging: bcm2835-camera: Replace open-coded idr with a struct idr." replaced an internal implementation of an idr with the standard functions and a spinlock. idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc to allocate the new node, but this is not valid whilst in an atomic context due to the spinlock.
There is no need for this to be a spinlock as a standard mutex is sufficient.
--- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +7 -6
@@ -161,7 +161,8 @@ struct vchiq_mmal_instance {void *bulk_scratch;struct idr context_map; -spinlock_t context_map_lock; +/* protect accesses to context_map */ +struct mutex context_map_lock;/* component to use next */ int component_idx;
@@ -184,10 +185,10 @@ get_msg_context(struct vchiq_mmal_instan* that when we service the VCHI reply, we can look up what * message is being replied to. */ -spin_lock (&instance->context_map_lock); +mutex_lock (&instance->context_map_lock); handle =idr_alloc (&instance->context_map, msg_context,0 ,0 ,GFP_KERNEL ); -spin_unlock (&instance->context_map_lock); +mutex_unlock (&instance->context_map_lock);if (handle <0 ) {kfree (msg_context);
@@ -211,9 +212,9 @@ release_msg_context(struct mmal_msg_cont {struct vchiq_mmal_instance *instance = msg_context->instance; -spin_lock (&instance->context_map_lock); +mutex_lock (&instance->context_map_lock);idr_remove (&instance->context_map, msg_context->handle); -spin_unlock (&instance->context_map_lock); +mutex_unlock (&instance->context_map_lock);kfree (msg_context); }
@@ -1849,7 +1850,7 @@ int vchiq_mmal_init(struct vchiq_mmal_in instance->bulk_scratch =vmalloc (PAGE_SIZE ); -spin_lock_init (&instance->context_map_lock); +mutex_init (&instance->context_map_lock);idr_init_base (&instance->context_map,1 ); params.callback_param = instance;
Greg Kroah-Hartman
maintainerPATCH 135/138 staging: bcm2835-camera: Ensure all buffers are returned on disable
In reply to Greg Kroah-HartmanFrom: Dave Stevenson <[email protected]>
commit 70ec64ccdaac5d8f634338e33b016c1c99831499 upstream.
With the recent change to match MMAL and V4L2 buffers there is a need to wait for all MMAL buffers to be returned during stop_streaming.
--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 22 +++++++--- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 4 + drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h | 3 + 3 files changed, 23 insertions(+), 6 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +16 -6
@@ -577,6 +577,7 @@ static void stop_streaming(struct vb2_quint ret;unsigned long timeout;struct bm2835_mmal_dev *dev =vb2_get_drv_priv (vq); +struct vchiq_mmal_port *port = dev->capture.port;v4l2_dbg (1 , bcm2835_v4l2_debug, &dev->v4l2_dev,"%s: dev:%p\n" , __func__, dev);
@@ -600,12 +601,6 @@ static void stop_streaming(struct vb2_qu &dev->capture.frame_count, sizeof(dev->capture.frame_count)); -/* wait for last frame to complete */ - timeout =wait_for_completion_timeout (&dev->capture.frame_cmplt,HZ ); -if (timeout ==0 ) -v4l2_err (&dev->v4l2_dev, -"timed out waiting for frame completion\n" ); -v4l2_dbg (1 , bcm2835_v4l2_debug, &dev->v4l2_dev,"disabling connection\n" );
@@ -620,6 +615,21 @@ static void stop_streaming(struct vb2_qu ret); } +/* wait for all buffers to be returned */ +while (atomic_read (&port->buffers_with_vpu)) { +v4l2_dbg (1 , bcm2835_v4l2_debug, &dev->v4l2_dev, +"%s: Waiting for buffers to be returned - %d outstanding\n" , + __func__,atomic_read (&port->buffers_with_vpu)); + timeout =wait_for_completion_timeout (&dev->capture.frame_cmplt, +HZ ); +if (timeout ==0 ) { +v4l2_err (&dev->v4l2_dev,"%s: Timeout waiting for buffers to be returned - %d outstanding\n" , + __func__, +atomic_read (&port->buffers_with_vpu)); +break ; + } + } +if (disable_camera (dev) <0 )v4l2_err (&dev->v4l2_dev,"Failed to disable camera\n" ); }
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +4 -0
@@ -240,6 +240,8 @@ static void buffer_work_cb(struct work_sstruct mmal_msg_context *msg_context = container_of(work, struct mmal_msg_context, u.bulk.work); +atomic_dec (&msg_context->u.bulk.port->buffers_with_vpu); + msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance, msg_context->u.bulk.port, msg_context->u.bulk.status,
@@ -380,6 +382,8 @@ buffer_from_host(struct vchiq_mmal_insta/* initialise work structure ready to schedule callback */ INIT_WORK (&msg_context->u.bulk.work, buffer_work_cb); +atomic_inc (&port->buffers_with_vpu); +/* prep the buffer from host message */ memset (&m,0xbc ,sizeof (m));/* just to make debug clearer */
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +3 -0
@@ -71,6 +71,9 @@ struct vchiq_mmal_port {struct list_head buffers;/* lock to serialise adding and removing buffers from list */ spinlock_t slock; + +/* Count of buffers the VPU has yet to return */ +atomic_t buffers_with_vpu;/* callback on buffer completion */ vchiq_mmal_buffer_cb buffer_cb;/* callback context */
Greg Kroah-Hartman
maintainerPATCH 136/138 staging: bcm2835-camera: Remove check of the number of buffers supplied
In reply to Greg Kroah-HartmanFrom: Dave Stevenson <[email protected]>
commit bb8e97006d701ae725a177f8f322e5a75fa761b7 upstream.
Before commit "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" there was a need to ensure that there were sufficient buffers supplied from the user to cover those being sent to the VPU (always 1).
Now the buffers are linked 1:1 between MMAL and V4L2, therefore there is no need for that check, and indeed it is wrong as there is no need to submit all the buffers before starting streaming.
--- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +0 -10
@@ -1328,16 +1328,6 @@ static int port_enable(struct vchiq_mmalif (port->enabled)return 0 ; -/* ensure there are enough buffers queued to cover the buffer headers */ -if (port->buffer_cb) { - hdr_count =0 ; -list_for_each (buf_head, &port->buffers) { - hdr_count++; - } -if (hdr_count < port->current_buffer.num) -return -ENOSPC ; - } - ret =port_action_port (instance, port,MMAL_MSG_PORT_ACTION_TYPE_ENABLE );if (ret)
Greg Kroah-Hartman
maintainerPATCH 138/138 staging: rtl8712: reduce stack usage, again
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit fbd6b25009ac76b2034168cd21d5e01f8c2d83d1 upstream.
An earlier patch I sent reduced the stack usage enough to get below the warning limit, and I could show this was safe, but with GCC_PLUGIN_STRUCTLEAK_BYREF_ALL, it gets worse again because large stack variables in the same function no longer overlap:
drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 'translate_scan.isra.2':drivers/staging/rtl8712/rtl871x_ioctl_linux.c:322:1: error: the frame size of 1200 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Split out the largest two blocks in the affected function into two separate functions and mark those noinline_for_stack.
--- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 159 ++++++++++++++------------ 1 file changed, 89 insertions(+), 70 deletions(-)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +89 -70
@@ -124,10 +124,91 @@ static inline void handle_group_key(stru } } -static noinline_for_stack char *translate_scan(struct _adapter *padapter, -struct iw_request_info *info, -struct wlan_network *pnetwork, -char *start,char *stop) +static noinline_for_stack char *translate_scan_wpa(struct iw_request_info *info, +struct wlan_network *pnetwork, +struct iw_event *iwe, +char *start,char *stop) +{ +/* parsing WPA/WPA2 IE */ +u8 buf[MAX_WPA_IE_LEN ]; +u8 wpa_ie[255 ], rsn_ie[255 ]; +u16 wpa_len =0 , rsn_len =0 ; +int n, i; + +r8712_get_sec_ie (pnetwork->network.IEs, + pnetwork->network.IELength, rsn_ie, &rsn_len, + wpa_ie, &wpa_len); +if (wpa_len >0 ) { +memset (buf,0 ,MAX_WPA_IE_LEN ); + n =sprintf (buf,"wpa_ie=" ); +for (i =0 ; i < wpa_len; i++) { + n +=snprintf (buf + n,MAX_WPA_IE_LEN - n, +"%02x" , wpa_ie[i]); +if (n >=MAX_WPA_IE_LEN ) +break ; + } +memset (iwe,0 ,sizeof (*iwe)); + iwe->cmd =IWEVCUSTOM ; + iwe->u.data.length = (u16 )strlen (buf); + start =iwe_stream_add_point (info, start, stop, + iwe, buf); +memset (iwe,0 ,sizeof (*iwe)); + iwe->cmd =IWEVGENIE ; + iwe->u.data.length = (u16 )wpa_len; + start =iwe_stream_add_point (info, start, stop, + iwe, wpa_ie); + } +if (rsn_len >0 ) { +memset (buf,0 ,MAX_WPA_IE_LEN ); + n =sprintf (buf,"rsn_ie=" ); +for (i =0 ; i < rsn_len; i++) { + n +=snprintf (buf + n,MAX_WPA_IE_LEN - n, +"%02x" , rsn_ie[i]); +if (n >=MAX_WPA_IE_LEN ) +break ; + } +memset (iwe,0 ,sizeof (*iwe)); + iwe->cmd =IWEVCUSTOM ; + iwe->u.data.length =strlen (buf); + start =iwe_stream_add_point (info, start, stop, + iwe, buf); +memset (iwe,0 ,sizeof (*iwe)); + iwe->cmd =IWEVGENIE ; + iwe->u.data.length = rsn_len; + start =iwe_stream_add_point (info, start, stop, iwe, + rsn_ie); + } + +return start; +} + +static noinline_for_stack char *translate_scan_wps(struct iw_request_info *info, +struct wlan_network *pnetwork, +struct iw_event *iwe, +char *start,char *stop) +{ +/* parsing WPS IE */ +u8 wps_ie[512 ]; +uint wps_ielen; + +if (r8712_get_wps_ie (pnetwork->network.IEs, + pnetwork->network.IELength, + wps_ie, &wps_ielen)) { +if (wps_ielen >2 ) { + iwe->cmd =IWEVGENIE ; + iwe->u.data.length = (u16 )wps_ielen; + start =iwe_stream_add_point (info, start, stop, + iwe, wps_ie); + } + } + +return start; +} + +static char *translate_scan (struct _adapter *padapter, +struct iw_request_info *info, +struct wlan_network *pnetwork, +char *start,char *stop) {struct iw_event iwe;struct ieee80211_ht_cap *pht_capie;
@@ -240,73 +321,11 @@ static noinline_for_stack char *translat/* Check if we added any event */ if ((current_val - start) >iwe_stream_lcp_len (info)) start = current_val; -/* parsing WPA/WPA2 IE */ - { -u8 buf[MAX_WPA_IE_LEN ]; -u8 wpa_ie[255 ], rsn_ie[255 ]; -u16 wpa_len =0 , rsn_len =0 ; -int n; - -r8712_get_sec_ie (pnetwork->network.IEs, - pnetwork->network.IELength, rsn_ie, &rsn_len, - wpa_ie, &wpa_len); -if (wpa_len >0 ) { -memset (buf,0 ,MAX_WPA_IE_LEN ); - n =sprintf (buf,"wpa_ie=" ); -for (i =0 ; i < wpa_len; i++) { - n +=snprintf (buf + n,MAX_WPA_IE_LEN - n, -"%02x" , wpa_ie[i]); -if (n >=MAX_WPA_IE_LEN ) -break ; - } -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; - iwe.u.data.length = (u16 )strlen (buf); - start =iwe_stream_add_point (info, start, stop, - &iwe, buf); -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVGENIE ; - iwe.u.data.length = (u16 )wpa_len; - start =iwe_stream_add_point (info, start, stop, - &iwe, wpa_ie); - } -if (rsn_len >0 ) { -memset (buf,0 ,MAX_WPA_IE_LEN ); - n =sprintf (buf,"rsn_ie=" ); -for (i =0 ; i < rsn_len; i++) { - n +=snprintf (buf + n,MAX_WPA_IE_LEN - n, -"%02x" , rsn_ie[i]); -if (n >=MAX_WPA_IE_LEN ) -break ; - } -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; - iwe.u.data.length =strlen (buf); - start =iwe_stream_add_point (info, start, stop, - &iwe, buf); -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVGENIE ; - iwe.u.data.length = rsn_len; - start =iwe_stream_add_point (info, start, stop, &iwe, - rsn_ie); - } - } - {/* parsing WPS IE */ -u8 wps_ie[512 ]; -uint wps_ielen; - -if (r8712_get_wps_ie (pnetwork->network.IEs, - pnetwork->network.IELength, - wps_ie, &wps_ielen)) { -if (wps_ielen >2 ) { - iwe.cmd =IWEVGENIE ; - iwe.u.data.length = (u16 )wps_ielen; - start =iwe_stream_add_point (info, start, stop, - &iwe, wps_ie); - } - } - } + start =translate_scan_wpa (info, pnetwork, &iwe, start, stop); + + start =translate_scan_wps (info, pnetwork, &iwe, start, stop); +/* Add quality statistics */ iwe.cmd =IWEVQUAL ; rssi =r8712_signal_scale_mapping (pnetwork->network.Rssi);
Greg Kroah-Hartman
maintainerPATCH 137/138 staging: bcm2835-camera: Handle empty EOS buffers whilst streaming
In reply to Greg Kroah-HartmanFrom: Dave Stevenson <[email protected]>
commit a26be06d6d96c10a9ab005e99d93fbb5d3babd98 upstream.
The change to mapping V4L2 to MMAL buffers 1:1 didn't handle the condition we get with raw pixel buffers (eg YUV and RGB) direct from the camera's stills port. That sends the pixel buffer and then an empty buffer with the EOS flag set. The EOS buffer wasn't handled and returned an error up the stack.
Handle the condition correctly by returning it to the component if streaming, or returning with an error if stopping streaming.
--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 21 +++++----- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +- 2 files changed, 15 insertions(+), 11 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +12 -9
@@ -337,16 +337,13 @@ static void buffer_cb(struct vchiq_mmal_return ; }else if (length ==0 ) {/* stream ended */ -if (buf) { -/* this should only ever happen if the port is -* disabled and there are buffers still queued +if (dev->capture.frame_count) { +/* empty buffer whilst capturing - expected to be an +* EOS, so grab another frame */ -vb2_buffer_done (&buf->vb.vb2_buf,VB2_BUF_STATE_ERROR ); -pr_debug ("Empty buffer" ); - }else if (dev->capture.frame_count) { -/* grab another frame */ if (is_capturing (dev)) { -pr_debug ("Grab another frame" ); +v4l2_dbg (1 , bcm2835_v4l2_debug, &dev->v4l2_dev, +"Grab another frame" ); vchiq_mmal_port_parameter_set( instance, dev->capture.camera_port,
@@ -354,8 +351,14 @@ static void buffer_cb(struct vchiq_mmal_ &dev->capture.frame_count, sizeof(dev->capture.frame_count)); } +if (vchiq_mmal_submit_buffer (instance, port, buf)) +v4l2_dbg (1 , bcm2835_v4l2_debug, &dev->v4l2_dev, +"Failed to return EOS buffer" ); }else { -/* signal frame completion */ +/* stopping streaming. +* return buffer, and signal frame completion +*/ +vb2_buffer_done (&buf->vb.vb2_buf,VB2_BUF_STATE_ERROR );complete (&dev->capture.frame_cmplt); } }else {
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +3 -2
@@ -290,8 +290,6 @@ static int bulk_receive(struct vchiq_mma/* store length */ msg_context->u.bulk.buffer_used = rd_len; - msg_context->u.bulk.mmal_flags = - msg->u.buffer_from_host.buffer_header.flags; msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts;
@@ -452,6 +450,9 @@ static void buffer_to_host_cb(struct vchreturn ; } + msg_context->u.bulk.mmal_flags = + msg->u.buffer_from_host.buffer_header.flags; +if (msg->h.status !=MMAL_MSG_STATUS_SUCCESS ) {/* message reception had an error */ pr_warn ("error %d in reply\n" , msg->h.status);
Greg Kroah-Hartman
maintainerPATCH 121/138 staging: comedi: amplc_pci230: fix null pointer deref on interrupt
In reply to Greg Kroah-HartmanFrom: Ian Abbott <[email protected]>
commit 7379e6baeddf580d01feca650ec1ad508b6ea8ee upstream.
The interrupt handler pci230_interrupt() causes a null pointer dereference for a PCI260 card. There is no analog output subdevice for a PCI260. The dev->write_subdev subdevice pointer and therefore the s_ao subdevice pointer variable will be NULL for a PCI260. The following call near the end of the interrupt handler results in the null pointer dereference for a PCI260:
comedi_handle_events(dev, s_ao);
Fix it by only calling the above function if s_ao is valid.
Note that the other uses of s_ao in the calls pci230_handle_ao_nofifo(dev, s_ao); and pci230_handle_ao_fifo(dev, s_ao); will never be reached for a PCI260, so they are safe.
--- drivers/staging/comedi/drivers/amplc_pci230.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/comedi/drivers/amplc_pci230.c +2 -1
@@ -2330,7 +2330,8 @@ static irqreturn_t pci230_interrupt(int devpriv->intr_running = false;spin_unlock_irqrestore (&devpriv->isr_spinlock, irqflags); -comedi_handle_events (dev, s_ao); +if (s_ao) +comedi_handle_events (dev, s_ao);comedi_handle_events (dev, s_ai);return IRQ_HANDLED ;
Greg Kroah-Hartman
maintainerPATCH 124/138 lkdtm: support llvm-objcopy
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
commit e9e08a07385e08f1a7f85c5d1e345c21c9564963 upstream.
With CONFIG_LKDTM=y and make OBJCOPY=llvm-objcopy, llvm-objcopy errors:
llvm-objcopy: error: --set-section-flags=.text conflicts with --rename-section=.text=.rodata
Rather than support setting flags then renaming sections vs renaming then setting flags, it's simpler to just change both at the same time via --rename-section. Adding the load flag is required for GNU objcopy to mark .rodata Type as PROGBITS after the rename.
This can be verified with:
$ readelf -S drivers/misc/lkdtm/rodata_objcopy.o
...
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
...
[ 1] .rodata PROGBITS 0000000000000000 00000040
0000000000000004 0000000000000000 A 0 0 4
...Which shows that .text is now renamed .rodata, the alloc flag A is set, the type is PROGBITS, and the section is not flagged as writeable W.
--- drivers/misc/lkdtm/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/lkdtm/Makefile +1 -2
@@ -15,8 +15,7 @@ KCOV_INSTRUMENT_rodata.o := n OBJCOPYFLAGS := OBJCOPYFLAGS_rodata_objcopy.o := \ - --set-section-flags .text=alloc,readonly \ - --rename-section .text=.rodata + --rename-section .text=.rodata,alloc,readonly,load targets += rodata.o rodata_objcopy.o $(obj)/rodata_objcopy.o: $(obj)/rodata.o FORCE $(call if_changed,objcopy)
Greg Kroah-Hartman
maintainerPATCH 125/138 binder: fix memory leak in error path
In reply to Greg Kroah-HartmanFrom: Todd Kjos <[email protected]>
commit 1909a671dbc3606685b1daf8b22a16f65ea7edda upstream.
syzkallar found a 32-byte memory leak in a rarely executed error case. The transaction complete work item was not freed if put_user() failed when writing the BR_TRANSACTION_COMPLETE to the user command buffer. Fixed by freeing it before put_user() is called.
--- drivers/android/binder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/android/binder.c +2 -2
@@ -4267,6 +4267,8 @@ retry:case BINDER_WORK_TRANSACTION_COMPLETE : {binder_inner_proc_unlock (proc); cmd =BR_TRANSACTION_COMPLETE ; +kfree (w); +binder_stats_deleted (BINDER_STAT_TRANSACTION_COMPLETE );if (put_user (cmd, (uint32_t __user *)ptr))return -EFAULT ; ptr +=sizeof (uint32_t );
@@ -4275,8 +4277,6 @@ retry:binder_debug (BINDER_DEBUG_TRANSACTION_COMPLETE ,"%d:%d BR_TRANSACTION_COMPLETE\n" , proc->pid, thread->pid); -kfree (w); -binder_stats_deleted (BINDER_STAT_TRANSACTION_COMPLETE ); }break ;case BINDER_WORK_NODE : { struct binder_node *node = container_of(w, struct binder_node, work);
Greg Kroah-Hartman
maintainerPATCH 126/138 binder: return errors from buffer copy functions
In reply to Greg Kroah-HartmanFrom: Todd Kjos <[email protected]>
commit bb4a2e48d5100ed3ff614df158a636bca3c6bf9f upstream.
The buffer copy functions assumed the caller would ensure correct alignment and that the memory to be copied was completely within the binder buffer. There have been a few cases discovered by syzkallar where a malformed transaction created by a user could violated the assumptions and resulted in a BUG_ON.
The fix is to remove the BUG_ON and always return the error to be handled appropriately by the caller.
--- drivers/android/binder.c | 151 ++++++++++++++++++++++++----------------- drivers/android/binder_alloc.c | 44 ++++++----- drivers/android/binder_alloc.h | 20 ++--- 3 files changed, 124 insertions(+), 91 deletions(-)
drivers/android/binder.c +91 -60
@@ -2068,10 +2068,9 @@ static size_t binder_get_object(struct b read_size =min_t (size_t,sizeof (*object), buffer->data_size - offset);if (offset > buffer->data_size || read_size <sizeof (*hdr) || - !IS_ALIGNED (offset,sizeof (u32))) +binder_alloc_copy_from_buffer (&proc->alloc, object, buffer, + offset, read_size))return 0 ; -binder_alloc_copy_from_buffer (&proc->alloc, object, buffer, - offset, read_size);/* Ok, now see if we read a complete object. */ hdr = &object->hdr;
@@ -2140,8 +2139,10 @@ static struct binder_buffer_object *bindreturn NULL ; buffer_offset = start_offset +sizeof (binder_size_t) * index; -binder_alloc_copy_from_buffer (&proc->alloc, &object_offset, - b, buffer_offset,sizeof (object_offset)); +if (binder_alloc_copy_from_buffer (&proc->alloc, &object_offset, + b, buffer_offset, +sizeof (object_offset))) +return NULL ; object_size =binder_get_object (proc, b, object_offset, object);if (!object_size || object->hdr.type !=BINDER_TYPE_PTR )return NULL ;
@@ -2221,10 +2222,12 @@ static bool binder_validate_fixup(structreturn false; last_min_offset = last_bbo->parent_offset +sizeof (uintptr_t ); buffer_offset = objects_start_offset + -sizeof (binder_size_t) * last_bbo->parent, -binder_alloc_copy_from_buffer (&proc->alloc, &last_obj_offset, - b, buffer_offset, -sizeof (last_obj_offset)); +sizeof (binder_size_t) * last_bbo->parent; +if (binder_alloc_copy_from_buffer (&proc->alloc, + &last_obj_offset, + b, buffer_offset, +sizeof (last_obj_offset))) +return false; }return (fixup_offset >= last_min_offset); }
@@ -2310,15 +2313,15 @@ static void binder_transaction_buffer_refor (buffer_offset = off_start_offset; buffer_offset < off_end_offset; buffer_offset +=sizeof (binder_size_t)) {struct binder_object_header *hdr; -size_t object_size; +size_t object_size =0 ;struct binder_object object;binder_size_t object_offset; -binder_alloc_copy_from_buffer (&proc->alloc, &object_offset, - buffer, buffer_offset, -sizeof (object_offset)); - object_size =binder_get_object (proc, buffer, - object_offset, &object); +if (!binder_alloc_copy_from_buffer (&proc->alloc, &object_offset, + buffer, buffer_offset, +sizeof (object_offset))) + object_size =binder_get_object (proc, buffer, + object_offset, &object);if (object_size ==0 ) {pr_err ("transaction release %d bad object at offset %lld, size %zd\n" , debug_id, (u64 )object_offset, buffer->data_size);
@@ -2441,15 +2444,16 @@ static void binder_transaction_buffer_refor (fd_index =0 ; fd_index < fda->num_fds; fd_index++) {u32 fd; +int err;binder_size_t offset = fda_offset + fd_index *sizeof (fd); -binder_alloc_copy_from_buffer (&proc->alloc, - &fd, - buffer, - offset, -sizeof (fd)); -binder_deferred_fd_close (fd); + err =binder_alloc_copy_from_buffer ( + &proc->alloc, &fd, buffer, + offset,sizeof (fd)); +WARN_ON (err); +if (!err) +binder_deferred_fd_close (fd); } }break ;default :
@@ -2692,11 +2696,12 @@ static int binder_translate_fd_array(strint ret;binder_size_t offset = fda_offset + fdi *sizeof (fd); -binder_alloc_copy_from_buffer (&target_proc->alloc, - &fd, t->buffer, - offset,sizeof (fd)); - ret =binder_translate_fd (fd, offset, t, thread, - in_reply_to); + ret =binder_alloc_copy_from_buffer (&target_proc->alloc, + &fd, t->buffer, + offset,sizeof (fd)); +if (!ret) + ret =binder_translate_fd (fd, offset, t, thread, + in_reply_to);if (ret <0 )return ret; }
@@ -2749,8 +2754,12 @@ static int binder_fixup_parent(struct bi } buffer_offset = bp->parent_offset + (uintptr_t )parent->buffer - (uintptr_t )b->user_data; -binder_alloc_copy_to_buffer (&target_proc->alloc, b, buffer_offset, - &bp->buffer,sizeof (bp->buffer)); +if (binder_alloc_copy_to_buffer (&target_proc->alloc, b, buffer_offset, + &bp->buffer,sizeof (bp->buffer))) { +binder_user_error ("%d:%d got transaction with invalid parent offset\n" , + proc->pid, thread->pid); +return -EINVAL ; + }return 0 ; }
@@ -3160,15 +3169,20 @@ static void binder_transaction(struct bi goto err_binder_alloc_buf_failed; }if (secctx) { +int err;size_t buf_offset =ALIGN (tr->data_size,sizeof (void *)) +ALIGN (tr->offsets_size,sizeof (void *)) +ALIGN (extra_buffers_size,sizeof (void *)) -ALIGN (secctx_sz,sizeof (u64)); t->security_ctx = (uintptr_t )t->buffer->user_data + buf_offset; -binder_alloc_copy_to_buffer (&target_proc->alloc, - t->buffer, buf_offset, - secctx, secctx_sz); + err =binder_alloc_copy_to_buffer (&target_proc->alloc, + t->buffer, buf_offset, + secctx, secctx_sz); +if (err) { + t->security_ctx =0 ; +WARN_ON (1 ); + }security_release_secctx (secctx, secctx_sz); secctx =NULL ; }
@@ -3234,11 +3248,16 @@ static void binder_transaction(struct bistruct binder_object object;binder_size_t object_offset; -binder_alloc_copy_from_buffer (&target_proc->alloc, - &object_offset, - t->buffer, - buffer_offset, -sizeof (object_offset)); +if (binder_alloc_copy_from_buffer (&target_proc->alloc, + &object_offset, + t->buffer, + buffer_offset, +sizeof (object_offset))) { + return_error =BR_FAILED_REPLY ; + return_error_param = -EINVAL ; + return_error_line = __LINE__; + goto err_bad_offset; + } object_size =binder_get_object (target_proc, t->buffer, object_offset, &object);if (object_size ==0 || object_offset < off_min) {
@@ -3262,15 +3281,17 @@ static void binder_transaction(struct bi fp =to_flat_binder_object (hdr); ret =binder_translate_binder (fp, t, thread); -if (ret <0 ) { + +if (ret <0 || +binder_alloc_copy_to_buffer (&target_proc->alloc, + t->buffer, + object_offset, + fp,sizeof (*fp))) { return_error =BR_FAILED_REPLY ; return_error_param = ret; return_error_line = __LINE__; goto err_translate_failed; } -binder_alloc_copy_to_buffer (&target_proc->alloc, - t->buffer, object_offset, - fp,sizeof (*fp)); }break ;case BINDER_TYPE_HANDLE :case BINDER_TYPE_WEAK_HANDLE : {
@@ -3278,15 +3299,16 @@ static void binder_transaction(struct bi fp =to_flat_binder_object (hdr); ret =binder_translate_handle (fp, t, thread); -if (ret <0 ) { +if (ret <0 || +binder_alloc_copy_to_buffer (&target_proc->alloc, + t->buffer, + object_offset, + fp,sizeof (*fp))) { return_error =BR_FAILED_REPLY ; return_error_param = ret; return_error_line = __LINE__; goto err_translate_failed; } -binder_alloc_copy_to_buffer (&target_proc->alloc, - t->buffer, object_offset, - fp,sizeof (*fp)); }break ;case BINDER_TYPE_FD : {
@@ -3296,16 +3318,17 @@ static void binder_transaction(struct biint ret =binder_translate_fd (fp->fd, fd_offset, t, thread, in_reply_to); -if (ret <0 ) { + fp->pad_binder =0 ; +if (ret <0 || +binder_alloc_copy_to_buffer (&target_proc->alloc, + t->buffer, + object_offset, + fp,sizeof (*fp))) { return_error =BR_FAILED_REPLY ; return_error_param = ret; return_error_line = __LINE__; goto err_translate_failed; } - fp->pad_binder =0 ; -binder_alloc_copy_to_buffer (&target_proc->alloc, - t->buffer, object_offset, - fp,sizeof (*fp)); }break ;case BINDER_TYPE_FDA : {struct binder_object ptr_object;
@@ -3393,15 +3416,16 @@ static void binder_transaction(struct bi num_valid, last_fixup_obj_off, last_fixup_min_off); -if (ret <0 ) { +if (ret <0 || +binder_alloc_copy_to_buffer (&target_proc->alloc, + t->buffer, + object_offset, + bp,sizeof (*bp))) { return_error =BR_FAILED_REPLY ; return_error_param = ret; return_error_line = __LINE__; goto err_translate_failed; } -binder_alloc_copy_to_buffer (&target_proc->alloc, - t->buffer, object_offset, - bp,sizeof (*bp)); last_fixup_obj_off = object_offset; last_fixup_min_off =0 ; }break ;
@@ -4139,20 +4163,27 @@ static int binder_apply_fd_fixups(structtrace_binder_transaction_fd_recv (t, fd, fixup->offset);fd_install (fd, fixup->file); fixup->file =NULL ; -binder_alloc_copy_to_buffer (&proc->alloc, t->buffer, - fixup->offset, &fd, -sizeof (u32)); +if (binder_alloc_copy_to_buffer (&proc->alloc, t->buffer, + fixup->offset, &fd, +sizeof (u32))) { + ret = -EINVAL ; +break ; + } }list_for_each_entry_safe (fixup, tmp, &t->fd_fixups, fixup_entry) {if (fixup->file) {fput (fixup->file); }else if (ret) {u32 fd; +int err; -binder_alloc_copy_from_buffer (&proc->alloc, &fd, - t->buffer, fixup->offset, -sizeof (fd)); -binder_deferred_fd_close (fd); + err =binder_alloc_copy_from_buffer (&proc->alloc, &fd, + t->buffer, + fixup->offset, +sizeof (fd)); +WARN_ON (err); +if (!err) +binder_deferred_fd_close (fd); }list_del (&fixup->fixup_entry);kfree (fixup);
drivers/android/binder_alloc.c +23 -21
63 lines not on this page · raw message
drivers/android/binder_alloc.h +10 -10
@@ -168,17 +168,17 @@ binder_alloc_copy_user_to_buffer(structconst void __user *from, size_t bytes); -void binder_alloc_copy_to_buffer (struct binder_alloc *alloc, -struct binder_buffer *buffer, -binder_size_t buffer_offset, -void *src, -size_t bytes); +int binder_alloc_copy_to_buffer (struct binder_alloc *alloc, +struct binder_buffer *buffer, +binder_size_t buffer_offset, +void *src, +size_t bytes); -void binder_alloc_copy_from_buffer (struct binder_alloc *alloc, -void *dest, -struct binder_buffer *buffer, -binder_size_t buffer_offset, -size_t bytes); +int binder_alloc_copy_from_buffer (struct binder_alloc *alloc, +void *dest, +struct binder_buffer *buffer, +binder_size_t buffer_offset, +size_t bytes);#endif /* _LINUX_BINDER_ALLOC_H */
Greg Kroah-Hartman
maintainerPATCH 127/138 iio: adc: stm32-adc: add missing vdda-supply
In reply to Greg Kroah-HartmanFrom: Fabrice Gasnier <[email protected]>
commit 7685010fca2ba0284f31fd1380df3cffc96d847e upstream.
Add missing vdda-supply, analog power supply, to STM32 ADC. When vdda is an independent supply, it needs to be properly turned on or off to supply the ADC.
--- drivers/iio/adc/stm32-adc-core.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/iio/adc/stm32-adc-core.c +20 -1
@@ -87,6 +87,7 @@ struct stm32_adc_priv_cfg {* @domain: irq domain reference * @aclk: clock reference for the analog circuitry * @bclk: bus clock common for all ADCs, depends on part used +* @vdda: vdda analog supply reference * @vref: regulator reference * @cfg: compatible configuration data * @common: common data for all ADC instances
@@ -97,6 +98,7 @@ struct stm32_adc_priv {struct irq_domain *domain;struct clk *aclk;struct clk *bclk; +struct regulator *vdda;struct regulator *vref;const struct stm32_adc_priv_cfg *cfg;struct stm32_adc_common common;
@@ -394,10 +396,16 @@ static int stm32_adc_core_hw_start(strucstruct stm32_adc_priv *priv =to_stm32_adc_priv (common);int ret; + ret =regulator_enable (priv->vdda); +if (ret <0 ) { +dev_err (dev,"vdda enable failed %d\n" , ret); +return ret; + } + ret =regulator_enable (priv->vref);if (ret <0 ) {dev_err (dev,"vref enable failed\n" ); -return ret; + goto err_vdda_disable; }if (priv->bclk) {
@@ -425,6 +433,8 @@ err_bclk_disable:clk_disable_unprepare (priv->bclk); err_regulator_disable:regulator_disable (priv->vref); +err_vdda_disable: +regulator_disable (priv->vdda);return ret; }
@@ -441,6 +451,7 @@ static void stm32_adc_core_hw_stop(strucif (priv->bclk)clk_disable_unprepare (priv->bclk);regulator_disable (priv->vref); +regulator_disable (priv->vdda); }static int stm32_adc_probe (struct platform_device *pdev)
@@ -468,6 +479,14 @@ static int stm32_adc_probe(struct platforeturn PTR_ERR (priv->common.base); priv->common.phys_base = res->start; + priv->vdda =devm_regulator_get (&pdev->dev,"vdda" ); +if (IS_ERR (priv->vdda)) { + ret =PTR_ERR (priv->vdda); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"vdda get failed, %d\n" , ret); +return ret; + } + priv->vref =devm_regulator_get (&pdev->dev,"vref" );if (IS_ERR (priv->vref)) { ret =PTR_ERR (priv->vref);
Greg Kroah-Hartman
maintainerPATCH 119/138 staging: comedi: dt282x: fix a null pointer deref on interrupt
In reply to Greg Kroah-HartmanFrom: Ian Abbott <[email protected]>
commit b8336be66dec06bef518030a0df9847122053ec5 upstream.
The interrupt handler dt282x_interrupt() causes a null pointer dereference for those supported boards that have no analog output support. For these boards, dev->write_subdev will be NULL and therefore the s_ao subdevice pointer variable will be NULL. In that case, the following call near the end of the interrupt handler results in a null pointer dereference:
comedi_handle_events(dev, s_ao);
Fix it by only calling the above function if s_ao is valid.
(There are other uses of s_ao by the interrupt handler that may or may not be reached depending on values of hardware registers. Trust that they are reliable for now.)
Note:
commit 4f6f009b204f ("staging: comedi: dt282x: use comedi_handle_events()") propagates an earlier error from
commit f21c74fa4cfe ("staging: comedi: dt282x: use cfc_handle_events()").
--- drivers/staging/comedi/drivers/dt282x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/comedi/drivers/dt282x.c +2 -1
@@ -557,7 +557,8 @@ static irqreturn_t dt282x_interrupt(int }#endif comedi_handle_events (dev, s); -comedi_handle_events (dev, s_ao); +if (s_ao) +comedi_handle_events (dev, s_ao);return IRQ_RETVAL (handled); }
Greg Kroah-Hartman
maintainerPATCH 128/138 carl9170: fix misuse of device driver API
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
commit feb09b2933275a70917a869989ea2823e7356be8 upstream.
This patch follows Alan Stern's recent patch:
"p54: Fix race between disconnect and firmware loading"
that overhauled carl9170 buggy firmware loading and driver unbinding procedures.
Since the carl9170 code was adapted from p54 it uses the same functions and is likely to have the same problem, but it's just that the syzbot hasn't reproduce them (yet).
a summary from the changes (copied from the p54 patch):
* Call usb_driver_release_interface() rather than device_release_driver().
* Lock udev (the interface's parent) before unbinding the driver instead of locking udev->parent.
* During the firmware loading process, take a reference to the USB interface instead of the USB device.
* Don't take an unnecessary reference to the device during probe (and then don't drop it during disconnect).
and
* Make sure to prevent use-after-free bugs by explicitly setting the driver context to NULL after signaling the completion.
--- drivers/net/wireless/ath/carl9170/usb.c | 39 +++++++++++++------------------- 1 file changed, 17 insertions(+), 22 deletions(-)
drivers/net/wireless/ath/carl9170/usb.c +17 -22
@@ -128,6 +128,8 @@ static const struct usb_device_id carl91 };MODULE_DEVICE_TABLE (usb, carl9170_usb_ids); +static struct usb_driver carl9170_driver; +static void carl9170_usb_submit_data_urb (struct ar9170 *ar) {struct urb *urb;
@@ -966,32 +968,28 @@ err_out:static void carl9170_usb_firmware_failed (struct ar9170 *ar) { -struct device *parent = ar->udev->dev.parent; -struct usb_device *udev; - -/* -* Store a copy of the usb_device pointer locally. -* This is because device_release_driver initiates -* carl9170_usb_disconnect, which in turn frees our -* driver context (ar). +/* Store a copies of the usb_interface and usb_device pointer locally. +* This is because release_driver initiates carl9170_usb_disconnect, +* which in turn frees our driver context (ar). */ - udev = ar->udev; +struct usb_interface *intf = ar->intf; +struct usb_device *udev = ar->udev;complete (&ar->fw_load_wait); +/* at this point 'ar' could be already freed. Don't use it anymore */ + ar =NULL ;/* unbind anything failed */ -if (parent) -device_lock (parent); - -device_release_driver (&udev->dev); -if (parent) -device_unlock (parent); +usb_lock_device (udev); +usb_driver_release_interface (&carl9170_driver, intf); +usb_unlock_device (udev); -usb_put_dev (udev); +usb_put_intf (intf); }static void carl9170_usb_firmware_finish (struct ar9170 *ar) { +struct usb_interface *intf = ar->intf;int err; err =carl9170_parse_firmware (ar);
@@ -1009,7 +1007,7 @@ static void carl9170_usb_firmware_finish goto err_unrx;complete (&ar->fw_load_wait); -usb_put_dev (ar->udev); +usb_put_intf (intf);return ; err_unrx:
@@ -1052,7 +1050,6 @@ static int carl9170_usb_probe(struct usbreturn PTR_ERR (ar); udev =interface_to_usbdev (intf); -usb_get_dev (udev); ar->udev = udev; ar->intf = intf; ar->features = id->driver_info;
@@ -1094,15 +1091,14 @@ static int carl9170_usb_probe(struct usbatomic_set (&ar->rx_anch_urbs,0 );atomic_set (&ar->rx_pool_urbs,0 ); -usb_get_dev (ar->udev); +usb_get_intf (intf);carl9170_set_state (ar,CARL9170_STOPPED ); err =request_firmware_nowait (THIS_MODULE ,1 ,CARL9170FW_NAME , &ar->udev->dev,GFP_KERNEL , ar, carl9170_usb_firmware_step2);if (err) { -usb_put_dev (udev); -usb_put_dev (udev); +usb_put_intf (intf);carl9170_free (ar); }return err;
@@ -1131,7 +1127,6 @@ static void carl9170_usb_disconnect(strucarl9170_release_firmware (ar);carl9170_free (ar); -usb_put_dev (udev); }#ifdef CONFIG_PM
Greg Kroah-Hartman
maintainerPATCH 122/138 staging: mt7621-pci: fix PCIE_FTS_NUM_LO macro
In reply to Greg Kroah-HartmanFrom: Sergio Paracuellos <[email protected]>
commit 0ae0cf509d28d8539b88b5f7f24558f5bfe57cdf upstream.
Add missing parenthesis to PCIE_FTS_NUM_LO macro to do the same it was being done in original code.
--- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/mt7621-pci/pci-mt7621.c +1 -1
@@ -40,7 +40,7 @@/* MediaTek specific configuration registers */ #define PCIE_FTS_NUM 0x70c#define PCIE_FTS_NUM_MASK GENMASK(15, 8) -#define PCIE_FTS_NUM_L0 (x) ((x) & 0xff << 8) +#define PCIE_FTS_NUM_L0 (x) (((x) & 0xff) << 8)/* rt_sysc_membase relative registers */ #define RALINK_PCIE_CLK_GEN 0x7c
Greg Kroah-Hartman
maintainerPATCH 123/138 HID: Add another Primax PIXART OEM mouse quirk
In reply to Greg Kroah-HartmanFrom: Sebastian Parschauer <[email protected]>
commit 4c12954965fdf33d8ae3883c1931fc29ca023cfb upstream.
The PixArt OEM mice are known for disconnecting every minute in runlevel 1 or 3 if they are not always polled. So add quirk ALWAYS_POLL for this Alienware branded Primax mouse as well.
Daniel Schepler (@dschepler) reported and tested the quirk.
Reference: https://github.com/sriemer/fix-linux-mouse/issues/15
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -1235,6 +1235,7 @@#define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05#define USB_DEVICE_ID_PRIMAX_REZEL 0x4e72#define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D0F 0x4d0f +#define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D65 0x4d65#define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4E22 0x4e22
drivers/hid/hid-quirks.c +1 -0
@@ -132,6 +132,7 @@ static const struct hid_device_id hid_qu { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_MOUSE_4D22), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D0F), HID_QUIRK_ALWAYS_POLL }, + { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D65), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4E22), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001), HID_QUIRK_NOGET },
Greg Kroah-Hartman
maintainerPATCH 110/138 Revert "serial: 8250: Dont service RX FIFO if interrupts are disabled"
In reply to Greg Kroah-HartmanFrom: Oliver Barta <[email protected]>
commit 3f2640ed7be838c3f05c0d2b0f7c7508e7431e48 upstream.
This reverts commit 2e9fe539108320820016f78ca7704a7342788380.
Reading LSR unconditionally but processing the error flags only if UART_IIR_RDI bit was set before in IIR may lead to a loss of transmission error information on UARTs where the transmission error flags are cleared by a read of LSR. Information are lost in case an error is detected right before the read of LSR while processing e.g. an UART_IIR_THRI interrupt.
--- drivers/tty/serial/8250/8250_port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/8250/8250_port.c +1 -2
@@ -1869,8 +1869,7 @@ int serial8250_handle_irq(struct uart_po status =serial_port_in (port,UART_LSR ); -if (status & (UART_LSR_DR |UART_LSR_BI ) && - iir &UART_IIR_RDI ) { +if (status & (UART_LSR_DR |UART_LSR_BI )) {if (!up->dma ||handle_rx_dma (up, iir)) status =serial8250_rx_chars (up, status); }
Greg Kroah-Hartman
maintainerPATCH 129/138 VMCI: Fix integer overflow in VMCI handle arrays
In reply to Greg Kroah-HartmanFrom: Vishnu DASA <[email protected]>
commit 1c2eb5b2853c9f513690ba6b71072d8eb65da16a upstream.
The VMCI handle array has an integer overflow in vmci_handle_arr_append_entry when it tries to expand the array. This can be triggered from a guest, since the doorbell link hypercall doesn't impose a limit on the number of doorbell handles that a VM can create in the hypervisor, and these handles are stored in a handle array.
In this change, we introduce a mandatory max capacity for handle arrays/lists to avoid excessive memory usage.
--- drivers/misc/vmw_vmci/vmci_context.c | 80 ++++++++++++++++-------------- drivers/misc/vmw_vmci/vmci_handle_array.c | 38 +++++++++----- drivers/misc/vmw_vmci/vmci_handle_array.h | 29 +++++++--- include/linux/vmw_vmci_defs.h | 11 +++- 4 files changed, 99 insertions(+), 59 deletions(-)
drivers/misc/vmw_vmci/vmci_context.c +45 -35
@@ -29,6 +29,9 @@#include "vmci_driver.h" #include "vmci_event.h" +/* Use a wide upper bound for the maximum contexts. */ +#define VMCI_MAX_CONTEXTS 2000 +/* * List of current VMCI contexts. Contexts can be added by * vmci_ctx_create() and removed via vmci_ctx_destroy().
@@ -125,19 +128,22 @@ struct vmci_ctx *vmci_ctx_create(u32 cid/* Initialize host-specific VMCI context. */ init_waitqueue_head (&context->host_context.wait_queue); - context->queue_pair_array =vmci_handle_arr_create (0 ); + context->queue_pair_array = +vmci_handle_arr_create (0 ,VMCI_MAX_GUEST_QP_COUNT );if (!context->queue_pair_array) { error = -ENOMEM ; goto err_free_ctx; } - context->doorbell_array =vmci_handle_arr_create (0 ); + context->doorbell_array = +vmci_handle_arr_create (0 ,VMCI_MAX_GUEST_DOORBELL_COUNT );if (!context->doorbell_array) { error = -ENOMEM ; goto err_free_qp_array; } - context->pending_doorbell_array =vmci_handle_arr_create (0 ); + context->pending_doorbell_array = +vmci_handle_arr_create (0 ,VMCI_MAX_GUEST_DOORBELL_COUNT );if (!context->pending_doorbell_array) { error = -ENOMEM ; goto err_free_db_array;
@@ -212,7 +218,7 @@ static int ctx_fire_notification(u32 con* We create an array to hold the subscribers we find when * scanning through all contexts. */ - subscriber_array =vmci_handle_arr_create (0 ); + subscriber_array =vmci_handle_arr_create (0 ,VMCI_MAX_CONTEXTS );if (subscriber_array ==NULL )return VMCI_ERROR_NO_MEM ;
@@ -631,20 +637,26 @@ int vmci_ctx_add_notification(u32 contexspin_lock (&context->lock); -list_for_each_entry (n, &context->notifier_list, node) { -if (vmci_handle_is_equal (n->handle, notifier->handle)) { - exists = true; -break ; +if (context->n_notifiers <VMCI_MAX_CONTEXTS ) { +list_for_each_entry (n, &context->notifier_list, node) { +if (vmci_handle_is_equal (n->handle, notifier->handle)) { + exists = true; +break ; + } } - } -if (exists) { -kfree (notifier); - result =VMCI_ERROR_ALREADY_EXISTS ; +if (exists) { +kfree (notifier); + result =VMCI_ERROR_ALREADY_EXISTS ; + }else { +list_add_tail_rcu (¬ifier->node, + &context->notifier_list); + context->n_notifiers++; + result =VMCI_SUCCESS ; + } }else { -list_add_tail_rcu (¬ifier->node, &context->notifier_list); - context->n_notifiers++; - result =VMCI_SUCCESS ; +kfree (notifier); + result =VMCI_ERROR_NO_MEM ; }spin_unlock (&context->lock);
@@ -729,8 +741,7 @@ static int vmci_ctx_get_chkpt_doorbells( u32 *buf_size, void **pbuf) {struct dbell_cpt_state *dbells; -size_t n_doorbells; -int i; +u32 i, n_doorbells; n_doorbells =vmci_handle_arr_get_size (context->doorbell_array);if (n_doorbells >0 ) {
@@ -868,7 +879,8 @@ int vmci_ctx_rcv_notifications_get(u32 cspin_lock (&context->lock); *db_handle_array = context->pending_doorbell_array; - context->pending_doorbell_array =vmci_handle_arr_create (0 ); + context->pending_doorbell_array = +vmci_handle_arr_create (0 ,VMCI_MAX_GUEST_DOORBELL_COUNT );if (!context->pending_doorbell_array) { context->pending_doorbell_array = *db_handle_array; *db_handle_array =NULL ;
@@ -950,12 +962,11 @@ int vmci_ctx_dbell_create(u32 context_idreturn VMCI_ERROR_NOT_FOUND ;spin_lock (&context->lock); -if (!vmci_handle_arr_has_entry (context->doorbell_array, handle)) { -vmci_handle_arr_append_entry (&context->doorbell_array, handle); - result =VMCI_SUCCESS ; - }else { +if (!vmci_handle_arr_has_entry (context->doorbell_array, handle)) + result =vmci_handle_arr_append_entry (&context->doorbell_array, + handle); +else result =VMCI_ERROR_DUPLICATE_ENTRY ; - }spin_unlock (&context->lock);vmci_ctx_put (context);
@@ -1091,15 +1102,16 @@ int vmci_ctx_notify_dbell(u32 src_cid,if (!vmci_handle_arr_has_entry ( dst_context->pending_doorbell_array, handle)) { -vmci_handle_arr_append_entry ( + result =vmci_handle_arr_append_entry ( &dst_context->pending_doorbell_array, handle); - -ctx_signal_notify (dst_context); -wake_up (&dst_context->host_context.wait_queue); - +if (result ==VMCI_SUCCESS ) { +ctx_signal_notify (dst_context); +wake_up (&dst_context->host_context.wait_queue); + } + }else { + result =VMCI_SUCCESS ; } - result =VMCI_SUCCESS ; }spin_unlock (&dst_context->lock); }
@@ -1126,13 +1138,11 @@ int vmci_ctx_qp_create(struct vmci_ctx *if (context ==NULL ||vmci_handle_is_invalid (handle))return VMCI_ERROR_INVALID_ARGS ; -if (!vmci_handle_arr_has_entry (context->queue_pair_array, handle)) { -vmci_handle_arr_append_entry (&context->queue_pair_array, - handle); - result =VMCI_SUCCESS ; - }else { +if (!vmci_handle_arr_has_entry (context->queue_pair_array, handle)) + result =vmci_handle_arr_append_entry ( + &context->queue_pair_array, handle); +else result =VMCI_ERROR_DUPLICATE_ENTRY ; - }return result; }
drivers/misc/vmw_vmci/vmci_handle_array.c +25 -13
@@ -16,24 +16,29 @@#include <linux/slab.h> #include "vmci_handle_array.h" -static size_t handle_arr_calc_size (size_t capacity) +static size_t handle_arr_calc_size (u32 capacity) { -return sizeof (struct vmci_handle_arr ) + +return VMCI_HANDLE_ARRAY_HEADER_SIZE + capacity *sizeof (struct vmci_handle ); } -struct vmci_handle_arr *vmci_handle_arr_create (size_t capacity) +struct vmci_handle_arr *vmci_handle_arr_create (u32 capacity,u32 max_capacity) {struct vmci_handle_arr *array; +if (max_capacity ==0 || capacity > max_capacity) +return NULL ; +if (capacity ==0 ) - capacity =VMCI_HANDLE_ARRAY_DEFAULT_SIZE ; + capacity =min ((u32 )VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY , + max_capacity); array =kmalloc (handle_arr_calc_size (capacity),GFP_ATOMIC );if (!array)return NULL ; array->capacity = capacity; + array->max_capacity = max_capacity; array->size =0 ;return array;
@@ -44,27 +49,34 @@ void vmci_handle_arr_destroy(struct vmcikfree (array); } -void vmci_handle_arr_append_entry (struct vmci_handle_arr **array_ptr, -struct vmci_handle handle) +int vmci_handle_arr_append_entry (struct vmci_handle_arr **array_ptr, +struct vmci_handle handle) {struct vmci_handle_arr *array = *array_ptr;if (unlikely (array->size >= array->capacity)) {/* reallocate. */ struct vmci_handle_arr *new_array; -size_t new_capacity = array->capacity *VMCI_ARR_CAP_MULT ; -size_t new_size =handle_arr_calc_size (new_capacity); +u32 capacity_bump =min (array->max_capacity - array->capacity, + array->capacity); +size_t new_size =handle_arr_calc_size (array->capacity + + capacity_bump); + +if (array->size >= array->max_capacity) +return VMCI_ERROR_NO_MEM ; new_array =krealloc (array, new_size,GFP_ATOMIC );if (!new_array) -return ; +return VMCI_ERROR_NO_MEM ; - new_array->capacity = new_capacity; + new_array->capacity += capacity_bump; *array_ptr = array = new_array; } array->entries[array->size] = handle; array->size++; + +return VMCI_SUCCESS ; }/*
@@ -74,7 +86,7 @@ struct vmci_handle vmci_handle_arr_remov struct vmci_handle entry_handle) {struct vmci_handle handle =VMCI_INVALID_HANDLE ; -size_t i; +u32 i;for (i =0 ; i < array->size; i++) {if (vmci_handle_is_equal (array->entries[i], entry_handle)) {
@@ -109,7 +121,7 @@ struct vmci_handle vmci_handle_arr_remov* Handle at given index, VMCI_INVALID_HANDLE if invalid index. */ struct vmci_handle -vmci_handle_arr_get_entry (const struct vmci_handle_arr *array,size_t index) +vmci_handle_arr_get_entry (const struct vmci_handle_arr *array,u32 index) {if (unlikely (index >= array->size))return VMCI_INVALID_HANDLE ;
@@ -120,7 +132,7 @@ vmci_handle_arr_get_entry(const struct vbool vmci_handle_arr_has_entry (const struct vmci_handle_arr *array,struct vmci_handle entry_handle) { -size_t i; +u32 i;for (i =0 ; i < array->size; i++)if (vmci_handle_is_equal (array->entries[i], entry_handle))
drivers/misc/vmw_vmci/vmci_handle_array.h +19 -10
@@ -17,32 +17,41 @@#define _VMCI_HANDLE_ARRAY_H_#include <linux/vmw_vmci_defs.h> +#include <linux/limits.h> #include <linux/types.h> -#define VMCI_HANDLE_ARRAY_DEFAULT_SIZE 4 -#define VMCI_ARR_CAP_MULT 2/* Array capacity multiplier */ -struct vmci_handle_arr { -size_t capacity; -size_t size; +u32 capacity; +u32 max_capacity; +u32 size; +u32 pad;struct vmci_handle entries[]; }; -struct vmci_handle_arr *vmci_handle_arr_create (size_t capacity); +#define VMCI_HANDLE_ARRAY_HEADER_SIZE \ + offsetof(struct vmci_handle_arr, entries) +/* Select a default capacity that results in a 64 byte sized array */ +#define VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY 6 +/* Make sure that the max array size can be expressed by a u32 */ +#define VMCI_HANDLE_ARRAY_MAX_CAPACITY \ + ((U32_MAX - VMCI_HANDLE_ARRAY_HEADER_SIZE - 1) / \ + sizeof(struct vmci_handle)) + +struct vmci_handle_arr *vmci_handle_arr_create (u32 capacity,u32 max_capacity);void vmci_handle_arr_destroy (struct vmci_handle_arr *array); -void vmci_handle_arr_append_entry (struct vmci_handle_arr **array_ptr, -struct vmci_handle handle); +int vmci_handle_arr_append_entry (struct vmci_handle_arr **array_ptr, +struct vmci_handle handle);struct vmci_handle vmci_handle_arr_remove_entry (struct vmci_handle_arr *array,struct vmci_handle entry_handle);struct vmci_handle vmci_handle_arr_remove_tail (struct vmci_handle_arr *array);struct vmci_handle -vmci_handle_arr_get_entry (const struct vmci_handle_arr *array,size_t index); +vmci_handle_arr_get_entry (const struct vmci_handle_arr *array,u32 index);bool vmci_handle_arr_has_entry (const struct vmci_handle_arr *array,struct vmci_handle entry_handle);struct vmci_handle *vmci_handle_arr_get_handles (struct vmci_handle_arr *array); -static inline size_t vmci_handle_arr_get_size ( +static inline u32 vmci_handle_arr_get_size (const struct vmci_handle_arr *array) {return array->size;
include/linux/vmw_vmci_defs.h +10 -1
@@ -69,9 +69,18 @@ enum {/* * A single VMCI device has an upper limit of 128MB on the amount of -* memory that can be used for queue pairs. +* memory that can be used for queue pairs. Since each queue pair +* consists of at least two pages, the memory limit also dictates the +* number of queue pairs a guest can create. */ #define VMCI_MAX_GUEST_QP_MEMORY (128 * 1024 * 1024) +#define VMCI_MAX_GUEST_QP_COUNT (VMCI_MAX_GUEST_QP_MEMORY / PAGE_SIZE / 2) + +/* +* There can be at most PAGE_SIZE doorbells since there is one doorbell +* per byte in the doorbell bitmap page. +*/ +#define VMCI_MAX_GUEST_DOORBELL_COUNT PAGE_SIZE/* * Queues with pre-mapped data pages must be small, so that we don't pin
Greg Kroah-Hartman
maintainerPATCH 120/138 staging: wilc1000: fix error path cleanup in wilc_wlan_initialize()
In reply to Greg Kroah-HartmanFrom: Ajay Singh <[email protected]>
commit 6419f818ababebc1116fb2d0e220bd4fe835d0e3 upstream.
For the error path in wilc_wlan_initialize(), the resources are not cleanup in the correct order. Reverted the previous changes and use the correct order to free during error condition.
--- drivers/staging/wilc1000/wilc_netdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/wilc_netdev.c +6 -6
@@ -530,17 +530,17 @@ static int wilc_wlan_initialize(struct n goto fail_locks; } -if (wl->gpio_irq &&init_irq (dev)) { - ret = -EIO ; - goto fail_locks; - } - ret =wlan_initialize_threads (dev);if (ret <0 ) { ret = -EIO ; goto fail_wilc_wlan; } +if (wl->gpio_irq &&init_irq (dev)) { + ret = -EIO ; + goto fail_threads; + } +if (!wl->dev_irq_num && wl->hif_func->enable_interrupt && wl->hif_func->enable_interrupt (wl)) {
@@ -596,7 +596,7 @@ fail_irq_enable: fail_irq_init:if (wl->dev_irq_num)deinit_irq (dev); - +fail_threads:wlan_deinitialize_threads (dev); fail_wilc_wlan:wilc_wlan_cleanup (dev);
Greg Kroah-Hartman
maintainerPATCH 80/138 ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL
In reply to Greg Kroah-Hartman[ Upstream commit 6f6a8622057c92408930c31698394fae1557b188 ]
A similar fix to Patch "ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL" is also needed by ip6_tunnel.
--- include/net/ip6_tunnel.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
include/net/ip6_tunnel.h +6 -3
@@ -158,9 +158,12 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,memset (skb->cb,0 ,sizeof (struct inet6_skb_parm )); pkt_len = skb->len -skb_inner_network_offset (skb); err =ip6_local_out (dev_net (skb_dst (skb)->dev), sk, skb); -if (unlikely (net_xmit_eval (err))) - pkt_len =-1 ; -iptunnel_xmit_stats (dev, pkt_len); + +if (dev) { +if (unlikely (net_xmit_eval (err))) + pkt_len =-1 ; +iptunnel_xmit_stats (dev, pkt_len); + } }#endif #endif
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 116/138 drivers/usb/typec/tps6598x.c: fix portinfo width
In reply to Greg Kroah-HartmanFrom: Nikolaus Voss <[email protected]>
commit 05da75fc651138e51ff74ace97174349910463f5 upstream.
Portinfo bit field is 3 bits wide, not 2 bits. This led to a wrong driver configuration for some tps6598x configurations.
--- drivers/usb/typec/tps6598x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tps6598x.c +1 -1
@@ -41,7 +41,7 @@#define TPS_STATUS_VCONN (s) (!!((s) & BIT(7)))/* TPS_REG_SYSTEM_CONF bits */ -#define TPS_SYSCONF_PORTINFO (c) ((c) & 3) +#define TPS_SYSCONF_PORTINFO (c) ((c) & 7)enum {TPS_PORTINFO_SINK ,
Greg Kroah-Hartman
maintainerPATCH 77/138 md: fix for divide error in status_resync
In reply to Greg Kroah-Hartman[ Upstream commit 9642fa73d073527b0cbc337cc17a47d545d82cd2 ]
Stopping external metadata arrays during resync/recovery causes retries, loop of interrupting and starting reconstruction, until it hit at good moment to stop completely. While these retries curr_mark_cnt can be small- especially on HDD drives, so subtraction result can be smaller than 0. However it is casted to uint without checking. As a result of it the status bar in /proc/mdstat while stopping is strange (it jumps between 0% and 99%).
The real problem occurs here after commit 72deb455b5ec ("block: remove CONFIG_LBDAF"). Sector_div() macro has been changed, now the divisor is casted to uint32. For db = -8 the divisior(db/32-1) becomes 0.
Check if db value can be really counted and replace these macro by div64_u64() inline.
--- drivers/md/md.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-)
drivers/md/md.c +22 -14
@@ -7617,9 +7617,9 @@ static void status_unused(struct seq_file *seq)static int status_resync (struct seq_file *seq,struct mddev *mddev) {sector_t max_sectors, resync, res; -unsigned long dt, db; -sector_t rt; -int scale; +unsigned long dt, db =0 ; +sector_t rt, curr_mark_cnt, resync_mark_cnt; +int scale, recovery_active;unsigned int per_milli; if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
@@ -7708,22 +7708,30 @@ static int status_resync(struct seq_file *seq, struct mddev *mddev)* db: blocks written from mark until now * rt: remaining time * -* rt is a sector_t, so could be 32bit or 64bit. -* So we divide before multiply in case it is 32bit and close -* to the limit. -* We scale the divisor (db) by 32 to avoid losing precision -* near the end of resync when the number of remaining sectors -* is close to 'db'. -* We then divide rt by 32 after multiplying by db to compensate. -* The '+1' avoids division by zero if db is very small. +* rt is a sector_t, which is always 64bit now. We are keeping +* the original algorithm, but it is not really necessary. +* +* Original algorithm: +* So we divide before multiply in case it is 32bit and close +* to the limit. +* We scale the divisor (db) by 32 to avoid losing precision +* near the end of resync when the number of remaining sectors +* is close to 'db'. +* We then divide rt by 32 after multiplying by db to compensate. +* The '+1' avoids division by zero if db is very small. */ dt = ((jiffies - mddev->resync_mark) /HZ );if (!dt) dt++; - db = (mddev->curr_mark_cnt -atomic_read (&mddev->recovery_active)) - - mddev->resync_mark_cnt; + + curr_mark_cnt = mddev->curr_mark_cnt; + recovery_active =atomic_read (&mddev->recovery_active); + resync_mark_cnt = mddev->resync_mark_cnt; + +if (curr_mark_cnt >= (recovery_active + resync_mark_cnt)) + db = curr_mark_cnt - (recovery_active + resync_mark_cnt); rt = max_sectors - resync;/* number of remaining sectors */ -sector_div (rt, db/32 +1 ); + rt =div64_u64 (rt, db/32 +1 ); rt *= dt; rt >>=5 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 100/138 perf thread-stack: Fix thread stack return from kernel for kernel-only case
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
commit 97860b483c5597663a174ff7405be957b4838391 upstream.
Commit f08046cb3082 ("perf thread-stack: Represent jmps to the start of a different symbol") had the side-effect of introducing more stack entries before return from kernel space.
When user space is also traced, those entries are popped before entry to user space, but when user space is not traced, they get stuck at the bottom of the stack, making the stack grow progressively larger.
Fix by detecting a return-from-kernel branch type, and popping kernel addresses from the stack then.
Note, the problem and fix affect the exported Call Graph / Tree but not the callindent option used by "perf script --call-trace".
Example:
perf-with-kcore record example -e intel_pt//k -- ls perf-with-kcore script example --itrace=bep -s ~/libexec/perf-core/scripts/python/export-to-sqlite.py example.db branches calls ~/libexec/perf-core/scripts/python/exported-sql-viewer.py example.db
Menu option: Reports -> Context-Sensitive Call Graph
Before: (showing Call Path column only)
Call Path
▶ perf
▼ ls
▼ 12111:12111
▶ setup_new_exec
▶ __task_pid_nr_ns
▶ perf_event_pid_type
▶ perf_event_comm_output
▶ perf_iterate_ctx
▶ perf_iterate_sb
▶ perf_event_comm
▶ __set_task_comm
▶ load_elf_binary
▶ search_binary_handler
▶ __do_execve_file.isra.41
▶ __x64_sys_execve
▶ do_syscall_64
▼ entry_SYSCALL_64_after_hwframe
▼ swapgs_restore_regs_and_return_to_usermode
▼ native_iret
▶ error_entry
▶ do_page_fault
▼ error_exit
▼ retint_user
▶ prepare_exit_to_usermode
▼ native_iret
▶ error_entry
▶ do_page_fault
▼ error_exit
▼ retint_user
▶ prepare_exit_to_usermode
▼ native_iret
▶ error_entry
▶ do_page_fault
▼ error_exit
▼ retint_user
▶ prepare_exit_to_usermode
▶ native_iretAfter: (showing Call Path column only)
Call Path
▶ perf
▼ ls
▼ 12111:12111
▶ setup_new_exec
▶ __task_pid_nr_ns
▶ perf_event_pid_type
▶ perf_event_comm_output
▶ perf_iterate_ctx
▶ perf_iterate_sb
▶ perf_event_comm
▶ __set_task_comm
▶ load_elf_binary
▶ search_binary_handler
▶ __do_execve_file.isra.41
▶ __x64_sys_execve
▶ do_syscall_64
▶ entry_SYSCALL_64_after_hwframe
▶ page_fault
▼ entry_SYSCALL_64
▼ do_syscall_64
▶ __x64_sys_brk
▶ __x64_sys_access
▶ __x64_sys_openat
▶ __x64_sys_newfstat
▶ __x64_sys_mmap
▶ __x64_sys_close
▶ __x64_sys_read
▶ __x64_sys_mprotect
▶ __x64_sys_arch_prctl
▶ __x64_sys_munmap
▶ exit_to_usermode_loop
▶ __x64_sys_set_tid_address
▶ __x64_sys_set_robust_list
▶ __x64_sys_rt_sigaction
▶ __x64_sys_rt_sigprocmask
▶ __x64_sys_prlimit64
▶ __x64_sys_statfs
▶ __x64_sys_ioctl
▶ __x64_sys_getdents64
▶ __x64_sys_write
▶ __x64_sys_exit_groupCommitter notes:
The first arg to the perf-with-kcore needs to be the same for the 'record' and 'script' lines, otherwise we'll record the perf.data file and kcore_dir/ files in one directory ('example') to then try to use it from the 'bep' directory, fix the instructions above it so that both use 'example'.
--- tools/perf/util/thread-stack.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
tools/perf/util/thread-stack.c +29 -1
@@ -625,6 +625,23 @@ static int thread_stack__bottom(struct t true, false); } +static int thread_stack__pop_ks (struct thread *thread,struct thread_stack *ts, +struct perf_sample *sample,u64 ref) +{ +u64 tm = sample->time; +int err; + +/* Return to userspace, so pop all kernel addresses */ +while (thread_stack__in_kernel (ts)) { + err =thread_stack__call_return (thread, ts, --ts->cnt, + tm, ref, true); +if (err) +return err; + } + +return 0 ; +} + static int thread_stack__no_call_return(struct thread *thread, struct thread_stack *ts, struct perf_sample *sample,
@@ -905,7 +922,18 @@ int thread_stack__process(struct thread ts->rstate =X86_RETPOLINE_DETECTED ; }else if (sample->flags &PERF_IP_FLAG_RETURN ) { -if (!sample->ip || !sample->addr) +if (!sample->addr) { +u32 return_from_kernel =PERF_IP_FLAG_SYSCALLRET | +PERF_IP_FLAG_INTERRUPT ; + +if (!(sample->flags & return_from_kernel)) +return 0 ; + +/* Pop kernel stack */ +return thread_stack__pop_ks (thread, ts, sample, ref); + } + +if (!sample->ip)return 0 ;/* x86 retpoline 'return' doesn't match the stack */
Greg Kroah-Hartman
maintainerPATCH 97/138 perf auxtrace: Fix itrace defaults for perf script
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
commit 355200e0f6a9ce14771625014aa469f5ecbd8977 upstream.
Commit 4eb068157121 ("perf script: Make itrace script default to all calls") does not work for the case when '--itrace' only is used, because default_no_sample is not being passed.
Example:
Before:
$ perf record -e intel_pt/cyc/u ls $ perf script --itrace > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt differ
After:
$ perf script --itrace > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt are identical
--- tools/perf/util/auxtrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/auxtrace.c +2 -1
@@ -1010,7 +1010,8 @@ int itrace_parse_synth_opts(const struct }if (!str) { -itrace_synth_opts__set_default (synth_opts, false); +itrace_synth_opts__set_default (synth_opts, + synth_opts->default_no_sample);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 96/138 perf intel-pt: Fix itrace defaults for perf script
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
commit 26f19c2eb7e54015564ff133b91983a74e84541b upstream.
Commit 4eb068157121 ("perf script: Make itrace script default to all calls") does not work because 'use_browser' is being used to determine whether to default to periodic sampling (i.e. better for perf report). The result is that nothing but CBR events display for perf script when no --itrace option is specified.
Fix by using 'default_no_sample' and 'inject' instead.
Example:
Before:
$ perf record -e intel_pt/cyc/u ls $ perf script > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt differ
After:
$ perf script > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt are identical
--- tools/perf/util/intel-pt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/intel-pt.c +2 -1
@@ -2588,7 +2588,8 @@ int intel_pt_process_auxtrace_info(union }else {itrace_synth_opts__set_default (&pt->synth_opts, session->itrace_synth_opts->default_no_sample); -if (use_browser !=-1 ) { +if (!session->itrace_synth_opts->default_no_sample && + !session->itrace_synth_opts->inject) { pt->synth_opts.branches = false; pt->synth_opts.callchain = true; }
Greg Kroah-Hartman
maintainerPATCH 95/138 block, bfq: NULL out the bic when its no longer valid
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
commit dbc3117d4ca9e17819ac73501e914b8422686750 upstream.
In reboot tests on several devices we were seeing a "use after free" when slub_debug or KASAN was enabled. The kernel complained about:
Unable to handle kernel paging request at virtual address 6b6b6c2b
...which is a classic sign of use after free under slub_debug. The stack crawl in kgdb looked like:
0 test_bit (addr=<optimized out>, nr=<optimized out>) 1 bfq_bfqq_busy (bfqq=<optimized out>) 2 bfq_select_queue (bfqd=<optimized out>) 3 __bfq_dispatch_request (hctx=<optimized out>) 4 bfq_dispatch_request (hctx=<optimized out>) 5 0xc056ef00 in blk_mq_do_dispatch_sched (hctx=0xed249440) 6 0xc056f728 in blk_mq_sched_dispatch_requests (hctx=0xed249440) 7 0xc0568d24 in __blk_mq_run_hw_queue (hctx=0xed249440) 8 0xc0568d94 in blk_mq_run_work_fn (work=<optimized out>) 9 0xc024c5c4 in process_one_work (worker=0xec6d4640, work=0xed249480)
10 0xc024cff4 in worker_thread (__worker=0xec6d4640)
Digging in kgdb, it could be found that, though bfqq looked fine, bfqq->bic had been freed.
Through further digging, I postulated that perhaps it is illegal to access a "bic" (AKA an "icq") after bfq_exit_icq() had been called because the "bic" can be freed at some point in time after this call is made. I confirmed that there certainly were cases where the exact crashing code path would access the "bic" after bfq_exit_icq() had been called. Sspecifically I set the "bfqq->bic" to (void *)0x7 and saw that the bic was 0x7 at the time of the crash.
To understand a bit more about why this crash was fairly uncommon (I saw it only once in a few hundred reboots), you can see that much of the time bfq_exit_icq_fbqq() fully frees the bfqq and thus it can't access the ->bic anymore. The only case it doesn't is if bfq_put_queue() sees a reference still held.
However, even in the case when bfqq isn't freed, the crash is still rare. Why? I tracked what happened to the "bic" after the exit routine. It doesn't get freed right away. Rather, put_io_context_active() eventually called put_io_context() which queued up freeing on a workqueue. The freeing then actually happened later than that through call_rcu(). Despite all these delays, some extra debugging showed that all the hoops could be jumped through in time and the memory could be freed causing the original crash. Phew!
To make a long story short, assuming it truly is illegal to access an icq after the "exit_icq" callback is finished, this patch is needed.
--- block/bfq-iosched.c | 1 + 1 file changed, 1 insertion(+)
block/bfq-iosched.c +1 -0
@@ -4265,6 +4265,7 @@ static void bfq_exit_icq_bfqq(struct bfqunsigned long flags;spin_lock_irqsave (&bfqd->lock, flags); + bfqq->bic =NULL ;bfq_exit_bfqq (bfqd, bfqq);bic_set_bfqq (bic,NULL , is_sync);spin_unlock_irqrestore (&bfqd->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 87/138 NFS4: Only set creation opendata if O_CREAT
In reply to Greg Kroah-Hartman[ Upstream commit 909105199a682cb09c500acd443d34b182846c9c ]
We can end up in nfs4_opendata_alloc during task exit, in which case current->fs has already been cleaned up. This leads to a crash in current_umask().
Fix this by only setting creation opendata if we are actually doing an open with O_CREAT. We can drop the check for NULL nfs4_open_createattrs, since O_CREAT will never be set for the recovery path.
--- fs/nfs/nfs4proc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
fs/nfs/nfs4proc.c +11 -9
@@ -1234,10 +1234,20 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,atomic_inc (&sp->so_count); p->o_arg.open_flags = flags; p->o_arg.fmode = fmode & (FMODE_READ |FMODE_WRITE ); - p->o_arg.umask =current_umask (); p->o_arg.claim =nfs4_map_atomic_open_claim (server, claim); p->o_arg.share_access =nfs4_map_atomic_open_share (server, fmode, flags); +if (flags &O_CREAT ) { + p->o_arg.umask =current_umask (); + p->o_arg.label =nfs4_label_copy (p->a_label, label); +if (c->sattr !=NULL && c->sattr->ia_valid !=0 ) { + p->o_arg.u.attrs = &p->attrs; +memcpy (&p->attrs, c->sattr,sizeof (p->attrs)); + +memcpy (p->o_arg.u.verifier.data, c->verf, +sizeof (p->o_arg.u.verifier.data)); + } + }/* don't put an ACCESS op in OPEN compound if O_EXCL, because ACCESS * will return permission denied for all bits until close */ if (!(flags &O_EXCL )) {
@@ -1261,7 +1271,6 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, p->o_arg.server = server; p->o_arg.bitmask =nfs4_bitmask (server, label); p->o_arg.open_bitmap = &nfs4_fattr_bitmap[0 ]; - p->o_arg.label =nfs4_label_copy (p->a_label, label);switch (p->o_arg.claim) {case NFS4_OPEN_CLAIM_NULL :case NFS4_OPEN_CLAIM_DELEGATE_CUR :
@@ -1274,13 +1283,6 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,case NFS4_OPEN_CLAIM_DELEG_PREV_FH : p->o_arg.fh =NFS_FH (d_inode (dentry)); } -if (c !=NULL && c->sattr !=NULL && c->sattr->ia_valid !=0 ) { - p->o_arg.u.attrs = &p->attrs; -memcpy (&p->attrs, c->sattr,sizeof (p->attrs)); - -memcpy (p->o_arg.u.verifier.data, c->verf, -sizeof (p->o_arg.u.verifier.data)); - } p->c_arg.fh = &p->o_res.fh; p->c_arg.stateid = &p->o_res.stateid; p->c_arg.seqid = p->o_arg.seqid;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 84/138 quota: fix a problem about transfer quota
In reply to Greg Kroah-Hartman[ Upstream commit c6d9c35d16f1bafd3fec64b865e569e48cbcb514 ]
Run below script as root, dquot_add_space will return -EDQUOT since __dquot_transfer call dquot_add_space with flags=0, and dquot_add_space think it's a preallocation. Fix it by set flags as DQUOT_SPACE_WARN.
mkfs.ext4 -O quota,project /dev/vdb mount -o prjquota /dev/vdb /mnt
setquota -P 23 1 1 0 0 /dev/vdb
dd if=/dev/zero of=/mnt/test-file bs=4K count=1 chattr -p 23 test-file
--- fs/quota/dquot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/quota/dquot.c +2 -2
@@ -1993,8 +1993,8 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) &warn_to[cnt]);if (ret) goto over_quota; - ret =dquot_add_space (transfer_to[cnt], cur_space, rsv_space,0 , - &warn_to[cnt]); + ret =dquot_add_space (transfer_to[cnt], cur_space, rsv_space, +DQUOT_SPACE_WARN , &warn_to[cnt]);if (ret) {spin_lock (&transfer_to[cnt]->dq_dqb_lock);dquot_decr_inodes (transfer_to[cnt], inode_usage);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 31/138 soundwire: stream: fix bad unlock balance
In reply to Greg Kroah-Hartman[ Upstream commit 9315d904c7e8f38886e2820fa6cb8d0fa723ea21 ]
the msg lock is taken for multi-link cases only but released unconditionally, leading to an unlock balance warning for single-link usages This patch fixes this.
=====================================
WARNING: bad unlock balance detected!
5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G W
-------------------------------------
aplay/2954 is trying to release lock (&bus->msg_lock) at:
do_bank_switch+0x21c/0x480 but there are no more locks to release!
--- drivers/soundwire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soundwire/stream.c +2 -1
@@ -805,7 +805,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream) goto error; } -mutex_unlock (&bus->msg_lock); +if (bus->multi_link) +mutex_unlock (&bus->msg_lock); }return ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 61/138 mac80211: do not start any work during reconfigure flow
In reply to Greg Kroah-Hartman[ Upstream commit f8891461a277ec0afc493fd30cd975a38048a038 ]
It is not a good idea to try to perform any work (e.g. send an auth frame) during reconfigure flow.
Prevent this from happening, and at the end of the reconfigure flow requeue all the works.
--- net/mac80211/ieee80211_i.h | 7 +++++++ net/mac80211/util.c | 4 ++++ 2 files changed, 11 insertions(+)
net/mac80211/ieee80211_i.h +7 -0
@@ -2034,6 +2034,13 @@ void __ieee80211_flush_queues(struct ieee80211_local *local,static inline bool ieee80211_can_run_worker (struct ieee80211_local *local) { +/* +* It's unsafe to try to do any work during reconfigure flow. +* When the flow ends the work will be requeued. +*/ +if (local->in_reconfig) +return false; +/* * If quiescing is set, we are racing with __ieee80211_suspend. * __ieee80211_suspend flushes the workers after setting quiescing,
net/mac80211/util.c +4 -0
@@ -2442,6 +2442,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)mutex_lock (&local->mtx);ieee80211_start_next_roc (local);mutex_unlock (&local->mtx); + +/* Requeue all works */ +list_for_each_entry (sdata, &local->interfaces, list) +ieee80211_queue_work (&local->hw, &sdata->work); } ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 51/138 KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy
In reply to Greg Kroah-Hartman[ Upstream commit 4729ec8c1e1145234aeeebad5d96d77f4ccbb00a ]
kvm_device->destroy() seems to be supposed to free its kvm_device struct, but vgic_its_destroy() is not currently doing this, resulting in a memory leak, resulting in kmemleak reports such as the following:
unreferenced object 0xffff800aeddfe280 (size 128):
comm "qemu-system-aar", pid 13799, jiffies 4299827317 (age 1569.844s) [...]
backtrace:
[<00000000a08b80e2>] kmem_cache_alloc+0x178/0x208
[<00000000dcad2bd3>] kvm_vm_ioctl+0x350/0xbc0Fix it.
--- virt/kvm/arm/vgic/vgic-its.c | 1 + 1 file changed, 1 insertion(+)
virt/kvm/arm/vgic/vgic-its.c +1 -0
@@ -1734,6 +1734,7 @@ static void vgic_its_destroy(struct kvm_device *kvm_dev)mutex_unlock (&its->its_lock);kfree (its); +kfree (kvm_dev);/* alloc by kvm_ioctl_create_device, free by .destroy */ } static int vgic_its_has_attr_regs(struct kvm_device *dev,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 28/138 mwifiex: Fix heap overflow in mwifiex_uap_parse_tail_ies()
In reply to Greg Kroah-Hartman[ Upstream commit 69ae4f6aac1578575126319d3f55550e7e440449 ]
A few places in mwifiex_uap_parse_tail_ies() perform memcpy() unconditionally, which may lead to either buffer overflow or read over boundary.
This patch addresses the issues by checking the read size and the destination size at each place more properly. Along with the fixes, the patch cleans up the code slightly by introducing a temporary variable for the token size, and unifies the error path with the standard goto statement.
--- drivers/net/wireless/marvell/mwifiex/ie.c | 47 +++++++++++++++-------- 1 file changed, 31 insertions(+), 16 deletions(-)
drivers/net/wireless/marvell/mwifiex/ie.c +31 -16
@@ -329,6 +329,8 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,struct ieee80211_vendor_ie *vendorhdr;u16 gen_idx =MWIFIEX_AUTO_IDX_MASK , ie_len =0 ;int left_len, parsed_len =0 ; +unsigned int token_len; +int err =0 ;if (!info->tail || !info->tail_len)return 0 ;
@@ -344,6 +346,12 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,*/ while (left_len >sizeof (struct ieee_types_header )) { hdr = (void *)(info->tail + parsed_len); + token_len = hdr->len +sizeof (struct ieee_types_header ); +if (token_len > left_len) { + err = -EINVAL ; + goto out; + } +switch (hdr->element_id) {case WLAN_EID_SSID :case WLAN_EID_SUPP_RATES :
@@ -361,17 +369,20 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,if (cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT ,WLAN_OUI_TYPE_MICROSOFT_WMM , (const u8 *)hdr, - hdr->len +sizeof (struct ieee_types_header ))) + token_len))break ;/* fall through */ default : -memcpy (gen_ie->ie_buffer + ie_len, hdr, - hdr->len +sizeof (struct ieee_types_header )); - ie_len += hdr->len +sizeof (struct ieee_types_header ); +if (ie_len + token_len >IEEE_MAX_IE_SIZE ) { + err = -EINVAL ; + goto out; + } +memcpy (gen_ie->ie_buffer + ie_len, hdr, token_len); + ie_len += token_len;break ; } - left_len -= hdr->len +sizeof (struct ieee_types_header ); - parsed_len += hdr->len +sizeof (struct ieee_types_header ); + left_len -= token_len; + parsed_len += token_len; }/* parse only WPA vendor IE from tail, WMM IE is configured by
@@ -381,15 +392,17 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,WLAN_OUI_TYPE_MICROSOFT_WPA , info->tail, info->tail_len);if (vendorhdr) { -memcpy (gen_ie->ie_buffer + ie_len, vendorhdr, - vendorhdr->len +sizeof (struct ieee_types_header )); - ie_len += vendorhdr->len +sizeof (struct ieee_types_header ); + token_len = vendorhdr->len +sizeof (struct ieee_types_header ); +if (ie_len + token_len >IEEE_MAX_IE_SIZE ) { + err = -EINVAL ; + goto out; + } +memcpy (gen_ie->ie_buffer + ie_len, vendorhdr, token_len); + ie_len += token_len; } -if (!ie_len) { -kfree (gen_ie); -return 0 ; - } +if (!ie_len) + goto out; gen_ie->ie_index =cpu_to_le16 (gen_idx); gen_ie->mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_BEACON |
@@ -399,13 +412,15 @@ static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv,if (mwifiex_update_uap_custom_ie (priv, gen_ie, &gen_idx,NULL ,NULL ,NULL ,NULL )) { -kfree (gen_ie); -return -1 ; + err = -EINVAL ; + goto out; } priv->gen_idx = gen_idx; + + out:kfree (gen_ie); -return 0 ; +return err; }/* This function parses different IEs-head & tail IEs, beacon IEs,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 40/138 ibmvnic: Do not close unopened driver during reset
In reply to Greg Kroah-Hartman[ Upstream commit 1f94608b0ce141be5286dde31270590bdf35b86a ]
Check driver state before halting it during a reset. If the driver is not running, do nothing. Otherwise, a request to deactivate a down link can cause an error and the reset will fail.
--- drivers/net/ethernet/ibm/ibmvnic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +2 -1
@@ -1751,7 +1751,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,ibmvnic_cleanup (netdev); -if (adapter->reset_reason !=VNIC_RESET_MOBILITY && +if (reset_state ==VNIC_OPEN && + adapter->reset_reason !=VNIC_RESET_MOBILITY && adapter->reset_reason !=VNIC_RESET_FAILOVER ) { rc =__ibmvnic_close (netdev);if (rc)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 39/138 net: phy: rename Asix Electronics PHY driver
In reply to Greg Kroah-Hartman[ Upstream commit a9520543b123bbd7275a0ab8d0375a5412683b41 ]
[Resent to net instead of net-next - may clash with Anders Roxell's patch series addressing duplicate module names]
Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver") introduced a new PHY driver drivers/net/phy/asix.c that causes a module name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded by that driver via its PHY ID. A rename of the driver looks unproblematic.
Rename PHY driver to ax88796b.c in order to resolve name conflict.
---
drivers/net/ethernet/8390/Kconfig | 2 +-
drivers/net/phy/Kconfig | 2 +-
drivers/net/phy/Makefile | 2 +-
drivers/net/phy/{asix.c => ax88796b.c} | 0
4 files changed, 3 insertions(+), 3 deletions(-)
rename drivers/net/phy/{asix.c => ax88796b.c} (100%)drivers/net/ethernet/8390/Kconfig +1 -1
@@ -49,7 +49,7 @@ config XSURF100 tristate "Amiga XSurf 100 AX88796/NE2000 clone support" depends on ZORRO select AX88796 - select ASIX_PHY + select AX88796B_PHY help This driver is for the Individual Computers X-Surf 100 Ethernet card (based on the Asix AX88796 chip). If you have such a card,
drivers/net/phy/Kconfig +1 -1
@@ -242,7 +242,7 @@ config AQUANTIA_PHY ---help--- Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 -config ASIX_PHY +config AX88796B_PHY tristate "Asix PHYs" help Currently supports the Asix Electronics PHY found in the X-Surf 100
drivers/net/phy/Makefile +1 -1
@@ -51,7 +51,7 @@ ifdef CONFIG_HWMON aquantia-objs += aquantia_hwmon.o endif obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o -obj-$(CONFIG_ASIX_PHY) += asix.o +obj-$(CONFIG_AX88796B_PHY) += ax88796b.o obj-$(CONFIG_AT803X_PHY) += at803x.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o obj-$(CONFIG_BCM7XXX_PHY) += bcm7xxx.o
drivers/net/phy/ax88796b.c renamed from drivers/net/phy/asix.c +0 -0
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 27/138 iwlwifi: Fix double-free problems in iwl_req_fw_callback()
In reply to Greg Kroah-Hartman[ Upstream commit a8627176b0de7ba3f4524f641ddff4abf23ae4e4 ]
In the error handling code of iwl_req_fw_callback(), iwl_dealloc_ucode() is called to free data. In iwl_drv_stop(), iwl_dealloc_ucode() is called again, which can cause double-free problems.
To fix this bug, the call to iwl_dealloc_ucode() in iwl_req_fw_callback() is deleted.
This bug is found by a runtime fuzzing tool named FIZZER written by us.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +0 -1
@@ -1579,7 +1579,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) goto free; out_free_fw: -iwl_dealloc_ucode (drv);release_firmware (ucode_raw); out_unbind:complete (&drv->request_firmware_complete);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 25/138 iwlwifi: clear persistence bit according to device family
In reply to Greg Kroah-Hartman[ Upstream commit 44f61b5c832c4085fcf476484efeaeef96dcfb8b ]
The driver attempts to clear persistence bit on any device familiy even though only 9000 and 22000 families require it. Clear the bit only on the relevant device families.
Each HW has different address to the write protection register. Use the right register for each HW
--- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 7 ++- .../net/wireless/intel/iwlwifi/pcie/trans.c | 46 +++++++++++++------ 2 files changed, 39 insertions(+), 14 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +6 -1
@@ -402,7 +402,12 @@ enum aux_misc_master1_en {#define AUX_MISC_MASTER1_SMPHR_STATUS 0xA20800#define RSA_ENABLE 0xA24B08#define PREG_AUX_BUS_WPROT_0 0xA04CC0 -#define PREG_PRPH_WPROT_0 0xA04CE0 + +/* device family 9000 WPROT register */ +#define PREG_PRPH_WPROT_9000 0xA04CE0 +/* device family 22000 WPROT register */ +#define PREG_PRPH_WPROT_22000 0xA04D00 +#define SB_CPU_1_STATUS 0xA01E30#define SB_CPU_2_STATUS 0xA01E34#define UMAG_SB_CPU_1_STATUS 0xA038C0
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +33 -13
65 lines not on this page · raw message
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 20/138 mac80211: free peer keys before vif down in mesh
In reply to Greg Kroah-Hartman[ Upstream commit 0112fa557c3bb3a002bc85760dc3761d737264d3 ]
freeing peer keys after vif down is resulting in peer key uninstall to fail due to interface lookup failure. so fix that.
--- net/mac80211/mesh.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/mesh.c +1 -0
@@ -929,6 +929,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)/* flush STAs and mpaths on this iface */ sta_info_flush (sdata); +ieee80211_free_keys (sdata, true);mesh_path_flush_by_iface (sdata);/* stop the beacon */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 2/138 crypto: lrw - use correct alignmask
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 20a0f9761343fba9b25ea46bd3a3e5e533d974f8 upstream.
Commit c778f96bf347 ("crypto: lrw - Optimize tweak computation") incorrectly reduced the alignmask of LRW instances from '__alignof__(u64) - 1' to '__alignof__(__be32) - 1'.
However, xor_tweak() and setkey() assume that the data and key, respectively, are aligned to 'be128', which has u64 alignment.
Fix the alignmask to be at least '__alignof__(be128) - 1'.
--- crypto/lrw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/lrw.c +1 -1
@@ -388,7 +388,7 @@ static int create(struct crypto_template inst->alg.base.cra_priority = alg->base.cra_priority; inst->alg.base.cra_blocksize =LRW_BLOCK_SIZE ; inst->alg.base.cra_alignmask = alg->base.cra_alignmask | - (__alignof__(__be32 ) -1 ); + (__alignof__(be128 ) -1 ); inst->alg.ivsize =LRW_BLOCK_SIZE ; inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg) +
Greg Kroah-Hartman
maintainerPATCH 17/138 soundwire: stream: fix out of boundary access on port properties
In reply to Greg Kroah-Hartman[ Upstream commit 03ecad90d3798be11b033248bbd4bbff4425a1c7 ]
Assigning local iterator to array element and using it again for indexing would cross the array boundary.
Fix this by directly referring array element without using the local variable.
--- drivers/soundwire/stream.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soundwire/stream.c +1 -3
@@ -1401,9 +1401,7 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, }for (i =0 ; i < num_ports; i++) { - dpn_prop = &dpn_prop[i]; - -if (dpn_prop->num == port_num) +if (dpn_prop[i].num == port_num)return &dpn_prop[i]; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 8/138 soc: brcmstb: Fix error path for unsupported CPUs
In reply to Greg Kroah-Hartman[ Upstream commit 490cad5a3ad6ef0bfd3168a5063140b982f3b22a ]
In case setup_hifcpubiuctrl_regs() returns an error, because of e.g:
an unsupported CPU type, just catch that error and return instead of blindly continuing with the initialization. This fixes a NULL pointer de-reference with the code continuing without having a proper array of registers to use.
--- drivers/soc/bcm/brcmstb/biuctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/soc/bcm/brcmstb/biuctrl.c +3 -1
@@ -246,7 +246,9 @@ static int __init brcmstb_biuctrl_init(void)if (!np)return 0 ; -setup_hifcpubiuctrl_regs (np); + ret =setup_hifcpubiuctrl_regs (np); +if (ret) +return ret; ret =mcp_write_pairing_set ();if (ret) {
Signature · 1 line
2.20.1
Jon Hunter
maintainerHi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module
...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget module
The above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or path usb4_tm not found
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or path usb4_tm not found
After reverting these two, I no longer see these errors.
Cheers,
Jon
Signature · 1 line
nvpublic
Greg Kroah-Hartman
maintainerQuoted 41 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget moduleThe above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot found
Quoted 5 lines
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or pathusb4_tmnot foundAfter reverting these two, I no longer see these errors.
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
greg k-h
Quoted 18 lines · Greg Kroah-Hartman
Quoted 17 lines · Jon Hunter
Hi Greg,
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Can you push that update into the git repository ? v5.1.17-137-gde182b90f76d still has the problem.
Also:
Building powerpc:ppc6xx_defconfig ... failed
drivers/crypto/talitos.c: In function ‘get_request_hdr’:include/linux/kernel.h:979:51: error:
dereferencing pointer to incomplete type ‘struct talitos_edesc’
Seen with both v4.19.58-92-gd66f8e7 and v5.1.17-137-gde182b90f76d.
This problem is caused by "crypto: talitos - fix hash on SEC1.", which will need a proper backport - struct talitos_edesc is declared later in the source file.
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.
Quoted 5 lines
thanks,
greg k-h
-------------
Hello,
Compiled and booted fine. No regressions on x86_64.
THX,
Jiunn
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 5.1.18-rc2
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.1.y
git commit: de182b90f76d9beac11a216bcdbe52542014de24
git describe: v5.1.17-137-gde182b90f76d
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.1-oe/build/v5.1.17-137-gde182b90f76d
No regressions (compared to build v5.1.17)
No fixes (compared to build v5.1.17)
Ran 22803 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libgpiod
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* network-basic-tests
* perf
* spectre-meltdown-checker-test
* v4l2-compliance
* ltp-open-posix-tests
* kvm-unit-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 23 lines · Guenter Roeck
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Jon Hunter
Hi Greg,
Quoted 18 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
-------------
Pseudo-Shortlog of commits:Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Can you push that update into the git repository ? v5.1.17-137-gde182b90f76d still has the problem.
Odd, I thought I did this. Pushed out again just to be sure.
Quoted 8 lines
Also:
Building powerpc:ppc6xx_defconfig ... failed
drivers/crypto/talitos.c: In function ‘get_request_hdr’:include/linux/kernel.h:979:51: error:
dereferencing pointer to incomplete type ‘struct talitos_edesc’
Quoted 5 lines
Seen with both v4.19.58-92-gd66f8e7 and v5.1.17-137-gde182b90f76d.
This problem is caused by "crypto: talitos - fix hash on SEC1.", which will need a proper backport - struct
talitos_edescis declared later in the source file.
Ick, let me go drop this one after breakfast...
greg k-h
Jon Hunter
maintainerQuoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget moduleThe above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot found
Quoted 7 lines
Quoted 5 lines
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or pathusb4_tmnot foundAfter reverting these two, I no longer see these errors.
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Hmmm ... -rc2 still not building ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:11.1-11 Label or path rtctarget not found
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or path usb4_tm not found
I still see the following commit in -rc2 ...
commit 0caa574b3244cd863dd74bde680a6309cb8803ad
Author: Keerthy <[email protected]> Date: Fri May 17 06:44:09 2019 +0530
ARM: dts: dra71x: Disable usb4_tm target module
In -rc1 I see there were 4 changes from Keerthy, any chance you reverted one of the rtc patches and not the above? Looks like the following is missing from -rc2 ...
Keerthy <[email protected]>
ARM: dts: dra76x: Disable rtc target module
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Guenter Roeck
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Can you push that update into the git repository ? v5.1.17-137-gde182b90f76d still has the problem.
Odd, I thought I did this. Pushed out again just to be sure.
Problem is still seen in -rc2.
Quoted 8 lines
Quoted 8 lines
Also:
Building powerpc:ppc6xx_defconfig ... failed
drivers/crypto/talitos.c: In function ‘get_request_hdr’:include/linux/kernel.h:979:51: error:
dereferencing pointer to incomplete type ‘struct talitos_edesc’
Quoted 8 lines
Quoted 5 lines
Seen with both v4.19.58-92-gd66f8e7 and v5.1.17-137-gde182b90f76d.
This problem is caused by "crypto: talitos - fix hash on SEC1.", which will need a proper backport - struct
talitos_edescis declared later in the source file.Ick, let me go drop this one after breakfast...
Turns out this affects all three branches (v4.19. v5.1, and v5.2).
Guenter
Greg Kroah-Hartman
maintainerQuoted 31 lines · Guenter Roeck
Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Guenter Roeck
Quoted 27 lines · Greg Kroah-Hartman
Quoted 24 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Can you push that update into the git repository ? v5.1.17-137-gde182b90f76d still has the problem.
Odd, I thought I did this. Pushed out again just to be sure.
Problem is still seen in -rc2.
Ugh, I dropped one, but not the other, now both gone. I'll push out updates in a bit.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Also:
Building powerpc:ppc6xx_defconfig ... failed
drivers/crypto/talitos.c: In function ‘get_request_hdr’:include/linux/kernel.h:979:51: error:
dereferencing pointer to incomplete type ‘struct talitos_edesc’Seen with both v4.19.58-92-gd66f8e7 and v5.1.17-137-gde182b90f76d.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
This problem is caused by "crypto: talitos - fix hash on SEC1.", which will need a proper backport - struct
talitos_edescis declared later in the source file.Ick, let me go drop this one after breakfast...
Turns out this affects all three branches (v4.19. v5.1, and v5.2).
Ok, dropping it now (sorry, longer than just breakfast...)
greg k-h
Greg Kroah-Hartman
maintainerQuoted 67 lines · Jon Hunter
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget moduleThe above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundQuoted 7 lines
Quoted 5 lines
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or pathusb4_tmnot foundAfter reverting these two, I no longer see these errors.
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Hmmm ... -rc2 still not building ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:11.1-11 Label or path rtctarget not found
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundI still see the following commit in -rc2 ...
commit
0caa574b3244cd863dd74bde680a6309cb8803adAuthor: Keerthy <[email protected]> Date: Fri May 17 06:44:09 2019 +0530
Quoted 8 lines
ARM: dts: dra71x: Disable
usb4_tmtarget moduleIn -rc1 I see there were 4 changes from Keerthy, any chance you reverted one of the rtc patches and not the above? Looks like the following is missing from -rc2 ...
Keerthy <[email protected]>
ARM: dts: dra76x: Disable rtc target module
Sorry, I dropped one, but not the other. Both now gone.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 17 lines · Jiunn Chang
Quoted 16 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
Quoted 7 lines
Quoted 3 lines
greg k-h
-------------
Hello,
Compiled and booted fine. No regressions on
x86_64.
Thanks for testing!
Jon Hunter
maintainerQuoted 70 lines · Greg Kroah-Hartman
Quoted 69 lines · Jon Hunter
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget moduleThe above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundQuoted 7 lines
Quoted 5 lines
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or pathusb4_tmnot foundAfter reverting these two, I no longer see these errors.
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Hmmm ... -rc2 still not building ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:11.1-11 Label or path rtctarget not found
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundI still see the following commit in -rc2 ...
commit
0caa574b3244cd863dd74bde680a6309cb8803adAuthor: Keerthy <[email protected]> Date: Fri May 17 06:44:09 2019 +0530ARM: dts: dra71x: Disable
usb4_tmtarget module
Quoted 8 lines
Quoted 6 lines
In -rc1 I see there were 4 changes from Keerthy, any chance you reverted one of the rtc patches and not the above? Looks like the following is missing from -rc2 ...
Keerthy <[email protected]>
ARM: dts: dra76x: Disable rtc target moduleSorry, I dropped one, but not the other. Both now gone.
Great! This looks better. All tests passing now ...
Test results for stable-v5.1:
12 builds: 12 pass, 0 fail
22 boots: 22 pass, 0 fail
32 tests: 32 pass, 0 failLinux version: 5.1.18-rc3-gd68c746af314
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Cheers
Jon
Signature · 1 line
nvpublic
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on x86_64. No dmesg regressions.
Thanks,
Luke
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
For v5.1.17-134-gd68c746af314:
Build results:
total: 159 pass: 159 fail: 0 Qemu test results: total: 364 pass: 364 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted with no regressions on my system.
Cheers,
Kelsey
Greg Kroah-Hartman
maintainerQuoted 84 lines · Jon Hunter
Quoted 70 lines · Greg Kroah-Hartman
Quoted 69 lines · Jon Hunter
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Jon Hunter
Hi Greg,
Quoted 20 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.1.18 release. There are 138 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun 14 Jul 2019 12:14:36 PM UTC. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.1.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.1.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra71x: Disableusb4_tmtarget module...
Quoted 2 lines
Keerthy <[email protected]>
ARM: dts: dra76x: Disableusb4_tmtarget moduleThe above commits are generating the following compilation errors for ARM ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundQuoted 7 lines
Quoted 5 lines
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra76x.dtsi:89.1-9 Label or pathusb4_tmnot foundAfter reverting these two, I no longer see these errors.
Both are now dropped, thanks. I'll push out a -rc2 with that changed.
Hmmm ... -rc2 still not building ...
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:11.1-11 Label or path rtctarget not found
Error:
/dvs/git/dirty/git-master_l4t-upstream/kernel/arch/arm/boot/dts/dra71x.dtsi:15.1-9 Label or pathusb4_tmnot foundI still see the following commit in -rc2 ...
commit
0caa574b3244cd863dd74bde680a6309cb8803adAuthor: Keerthy <[email protected]> Date: Fri May 17 06:44:09 2019 +0530ARM: dts: dra71x: Disable
usb4_tmtarget moduleQuoted 8 lines
Quoted 6 lines
In -rc1 I see there were 4 changes from Keerthy, any chance you reverted one of the rtc patches and not the above? Looks like the following is missing from -rc2 ...
Keerthy <[email protected]>
ARM: dts: dra76x: Disable rtc target moduleSorry, I dropped one, but not the other. Both now gone.
Great! This looks better. All tests passing now ...
Test results for stable-v5.1:
Quoted 8 lines
12 builds: 12 pass, 0 fail 22 boots: 22 pass, 0 fail 32 tests: 32 pass, 0 failLinux version: 5.1.18-rc3-gd68c746af314
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,tegra194-p2972-0000, tegra20-ventana, tegra210-p2371-2180, tegra30-cardhu-a04
Wonderful, thanks for testing and letting me know.
greg k-h