Kernel
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- 34 participants
- 18120 discussions

[PATCH openEuler-1.0-LTS 1/2] etmem:fix kasan slab-out-of-bounds in do_swapcache_reclaim
by Laibin Qiu 20 Jul '22
by Laibin Qiu 20 Jul '22
20 Jul '22
From: liubo <liubo254(a)huawei.com>
euleros inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GN7K
CVE: NA
--------------------------------
In the do_swapcache_reclaim interface,
there is a slab-out-of-bounds kasan problem;
The reason for the problem is that when
list_for_each_entry_safe_reverse_from traverses
the LRU linked list, it does not consider that next may be
equal to the head address, which may lead to the
head address being accessed as the page address,
causing problems.
In response to the above problems,
add a judgment about whether pos is head.
Signed-off-by: liubo <liubo254(a)huawei.com>
Reviewed-by: Miaohe Lin <linmiaohe(a)huawei.com>
Reviewed-by: wangkefeng <wangkefeng.wang(a)huawei.com>
Signed-off-by: Laibin Qiu <qiulaibin(a)huawei.com>
---
mm/vmscan.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 42f24473756b..011827f666cc 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4555,7 +4555,6 @@ EXPORT_SYMBOL_GPL(get_page_from_vaddr);
static int add_page_for_reclaim_swapcache(struct page *page,
struct list_head *pagelist, struct lruvec *lruvec, enum lru_list lru)
{
- struct list_head *src = &lruvec->lists[lru];
struct page *head;
/* If the page is mapped by more than one process, do not swap it */
@@ -4574,7 +4573,6 @@ static int add_page_for_reclaim_swapcache(struct page *page,
reliable_lru_add(lru, head, -hpage_nr_pages(head));
break;
case -EBUSY:
- list_move(&head->lru, src);
return -1;
default:
break;
@@ -4744,7 +4742,7 @@ int do_swapcache_reclaim(unsigned long *swapcache_watermark,
* check if pos page is been released or not in LRU list, if true,
* cancel the subsequent page scanning of the current node.
*/
- if (!pos) {
+ if (!pos || &pos->lru == src) {
spin_unlock_irq(&pgdat->lru_lock);
continue;
}
--
2.25.1
1
1

[PATCH openEuler-1.0-LTS 1/8] ext4: fix race condition between ext4_ioctl_setflags and ext4_fiemap
by Yongqiang Liu 20 Jul '22
by Yongqiang Liu 20 Jul '22
20 Jul '22
From: Baokun Li <libaokun1(a)huawei.com>
hulk inclusion
category: bugfix
bugzilla: 187222, https://gitee.com/openeuler/kernel/issues/I5H3KE
CVE: NA
--------------------------------
Hulk Robot reported a BUG:
==================================================================
kernel BUG at fs/ext4/extents_status.c:762!
invalid opcode: 0000 [#1] SMP KASAN PTI
[...]
Call Trace:
ext4_cache_extents+0x238/0x2f0
ext4_find_extent+0x785/0xa40
ext4_fiemap+0x36d/0xe90
do_vfs_ioctl+0x6af/0x1200
[...]
==================================================================
Above issue may happen as follows:
-------------------------------------
cpu1 cpu2
_____________________|_____________________
do_vfs_ioctl
ext4_ioctl
ext4_ioctl_setflags
ext4_ind_migrate
do_vfs_ioctl
ioctl_fiemap
ext4_fiemap
ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)
ext4_fill_fiemap_extents
down_write(&EXT4_I(inode)->i_data_sem);
ext4_ext_check_inode
ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS)
memset(ei->i_data, 0, sizeof(ei->i_data))
up_write(&EXT4_I(inode)->i_data_sem);
down_read(&EXT4_I(inode)->i_data_sem);
ext4_find_extent
ext4_cache_extents
ext4_es_cache_extent
BUG_ON(end < lblk)
We can easily reproduce this problem with the syzkaller testcase:
```
02:37:07 executing program 3:
r0 = openat(0xffffffffffffff9c, &(0x7f0000000040)='./file0\x00', 0x26e1, 0x0)
ioctl$FS_IOC_FSSETXATTR(r0, 0x40086602, &(0x7f0000000080)={0x17e})
mkdirat(0xffffffffffffff9c, &(0x7f00000000c0)='./file1\x00', 0x1ff)
r1 = openat(0xffffffffffffff9c, &(0x7f0000000100)='./file1\x00', 0x0, 0x0)
ioctl$FS_IOC_FIEMAP(r1, 0xc020660b, &(0x7f0000000180)={0x0, 0x1, 0x0, 0xef3, 0x6, []}) (async, rerun: 32)
ioctl$FS_IOC_FSSETXATTR(r1, 0x40086602, &(0x7f0000000140)={0x17e}) (rerun: 32)
```
To solve this issue, we use __generic_block_fiemap() instead of
generic_block_fiemap() and add inode_lock_shared to avoid race condition.
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
Reviewed-by: Zhang Yi <yi.zhang(a)huawei.com>
Signed-off-by: Yongqiang Liu <liuyongqiang13(a)huawei.com>
---
fs/ext4/extents.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d08e6d4afba6..8e5ed3e315cd 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5267,13 +5267,18 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
return error;
}
+ inode_lock_shared(inode);
/* fallback to generic here if not in extents fmt */
- if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
- return generic_block_fiemap(inode, fieinfo, start, len,
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
+ error = __generic_block_fiemap(inode, fieinfo, start, len,
ext4_get_block);
+ goto out_unlock;
+ }
- if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS))
- return -EBADR;
+ if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS)) {
+ error = -EBADR;
+ goto out_unlock;
+ }
if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) {
error = ext4_xattr_fiemap(inode, fieinfo);
@@ -5294,6 +5299,8 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
error = ext4_fill_fiemap_extents(inode, start_blk,
len_blks, fieinfo);
}
+out_unlock:
+ inode_unlock_shared(inode);
return error;
}
--
2.25.1
1
7

[PATCH openEuler-5.10 01/29] crypto: hisilicon/sec - don't sleep when in softirq
by Zheng Zengkai 19 Jul '22
by Zheng Zengkai 19 Jul '22
19 Jul '22
From: Zhengchao Shao <shaozhengchao(a)huawei.com>
mainline inclusion
from mainline-v5.19-rc6
commit 02884a4f12de11f54d4ca67a07dd1f111d96fdbd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GEVR
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git/c…
--------------------------------
When kunpeng920 encryption driver is used to deencrypt and decrypt
packets during the softirq, it is not allowed to use mutex lock. The
kernel will report the following error:
BUG: scheduling while atomic: swapper/57/0/0x00000300
Call trace:
dump_backtrace+0x0/0x1e4
show_stack+0x20/0x2c
dump_stack+0xd8/0x140
__schedule_bug+0x68/0x80
__schedule+0x728/0x840
schedule+0x50/0xe0
schedule_preempt_disabled+0x18/0x24
__mutex_lock.constprop.0+0x594/0x5dc
__mutex_lock_slowpath+0x1c/0x30
mutex_lock+0x50/0x60
sec_request_init+0x8c/0x1a0 [hisi_sec2]
sec_process+0x28/0x1ac [hisi_sec2]
sec_skcipher_crypto+0xf4/0x1d4 [hisi_sec2]
sec_skcipher_encrypt+0x1c/0x30 [hisi_sec2]
crypto_skcipher_encrypt+0x2c/0x40
crypto_authenc_encrypt+0xc8/0xfc [authenc]
crypto_aead_encrypt+0x2c/0x40
echainiv_encrypt+0x144/0x1a0 [echainiv]
crypto_aead_encrypt+0x2c/0x40
esp_output_tail+0x348/0x5c0 [esp4]
esp_output+0x120/0x19c [esp4]
xfrm_output_one+0x25c/0x4d4
xfrm_output_resume+0x6c/0x1fc
xfrm_output+0xac/0x3c0
xfrm4_output+0x64/0x130
ip_build_and_send_pkt+0x158/0x20c
tcp_v4_send_synack+0xdc/0x1f0
tcp_conn_request+0x7d0/0x994
tcp_v4_conn_request+0x58/0x6c
tcp_v6_conn_request+0xf0/0x100
tcp_rcv_state_process+0x1cc/0xd60
tcp_v4_do_rcv+0x10c/0x250
tcp_v4_rcv+0xfc4/0x10a4
ip_protocol_deliver_rcu+0xf4/0x200
ip_local_deliver_finish+0x58/0x70
ip_local_deliver+0x68/0x120
ip_sublist_rcv_finish+0x70/0x94
ip_list_rcv_finish.constprop.0+0x17c/0x1d0
ip_sublist_rcv+0x40/0xb0
ip_list_rcv+0x140/0x1dc
__netif_receive_skb_list_core+0x154/0x28c
__netif_receive_skb_list+0x120/0x1a0
netif_receive_skb_list_internal+0xe4/0x1f0
napi_complete_done+0x70/0x1f0
gro_cell_poll+0x9c/0xb0
napi_poll+0xcc/0x264
net_rx_action+0xd4/0x21c
__do_softirq+0x130/0x358
irq_exit+0x11c/0x13c
__handle_domain_irq+0x88/0xf0
gic_handle_irq+0x78/0x2c0
el1_irq+0xb8/0x140
arch_cpu_idle+0x18/0x40
default_idle_call+0x5c/0x1c0
cpuidle_idle_call+0x174/0x1b0
do_idle+0xc8/0x160
cpu_startup_entry+0x30/0x11c
secondary_start_kernel+0x158/0x1e4
softirq: huh, entered softirq 3 NET_RX 0000000093774ee4 with
preempt_count 00000100, exited with fffffe00?
Fixes: 416d82204df4 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
Signed-off-by: Zhengchao Shao <shaozhengchao(a)huawei.com>
Signed-off-by: Herbert Xu <herbert(a)gondor.apana.org.au>
Signed-off-by: Zhengchao Shao <shaozhengchao(a)huawei.com>
Reviewed-by: Yue Haibing <yuehaibing(a)huawei.com>
Reviewed-by: Wei Yongjun <weiyongjun1(a)huawei.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
---
drivers/crypto/hisilicon/sec2/sec.h | 2 +-
drivers/crypto/hisilicon/sec2/sec_crypto.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/crypto/hisilicon/sec2/sec.h b/drivers/crypto/hisilicon/sec2/sec.h
index c2e9b01187a7..a44c8dba3cda 100644
--- a/drivers/crypto/hisilicon/sec2/sec.h
+++ b/drivers/crypto/hisilicon/sec2/sec.h
@@ -119,7 +119,7 @@ struct sec_qp_ctx {
struct idr req_idr;
struct sec_alg_res res[QM_Q_DEPTH];
struct sec_ctx *ctx;
- struct mutex req_lock;
+ spinlock_t req_lock;
struct list_head backlog;
struct hisi_acc_sgl_pool *c_in_pool;
struct hisi_acc_sgl_pool *c_out_pool;
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index 6eebe739893c..71dfa7db6394 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -127,11 +127,11 @@ static int sec_alloc_req_id(struct sec_req *req, struct sec_qp_ctx *qp_ctx)
{
int req_id;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
req_id = idr_alloc_cyclic(&qp_ctx->req_idr, NULL,
0, QM_Q_DEPTH, GFP_ATOMIC);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
if (unlikely(req_id < 0)) {
dev_err(req->ctx->dev, "alloc req id fail!\n");
return req_id;
@@ -156,9 +156,9 @@ static void sec_free_req_id(struct sec_req *req)
qp_ctx->req_list[req_id] = NULL;
req->qp_ctx = NULL;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
idr_remove(&qp_ctx->req_idr, req_id);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
}
static u8 pre_parse_finished_bd(struct bd_status *status, void *resp)
@@ -273,7 +273,7 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)
!(req->flag & CRYPTO_TFM_REQ_MAY_BACKLOG))
return -EBUSY;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe);
if (ctx->fake_req_limit <=
@@ -281,10 +281,10 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)
list_add_tail(&req->backlog_head, &qp_ctx->backlog);
atomic64_inc(&ctx->sec->debug.dfx.send_cnt);
atomic64_inc(&ctx->sec->debug.dfx.send_busy_cnt);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
return -EBUSY;
}
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
if (unlikely(ret == -EBUSY))
return -ENOBUFS;
@@ -487,7 +487,7 @@ static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,
qp->req_cb = sec_req_cb;
- mutex_init(&qp_ctx->req_lock);
+ spin_lock_init(&qp_ctx->req_lock);
idr_init(&qp_ctx->req_idr);
INIT_LIST_HEAD(&qp_ctx->backlog);
@@ -1382,7 +1382,7 @@ static struct sec_req *sec_back_req_clear(struct sec_ctx *ctx,
{
struct sec_req *backlog_req = NULL;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
if (ctx->fake_req_limit >=
atomic_read(&qp_ctx->qp->qp_status.used) &&
!list_empty(&qp_ctx->backlog)) {
@@ -1390,7 +1390,7 @@ static struct sec_req *sec_back_req_clear(struct sec_ctx *ctx,
typeof(*backlog_req), backlog_head);
list_del(&backlog_req->backlog_head);
}
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
return backlog_req;
}
--
2.20.1
1
28

[PATCH openEuler-5.10-LTS 1/5] crypto: hisilicon/sec - don't sleep when in softirq
by Zheng Zengkai 19 Jul '22
by Zheng Zengkai 19 Jul '22
19 Jul '22
From: Zhengchao Shao <shaozhengchao(a)huawei.com>
mainline inclusion
from mainline-v5.19-rc6
commit 02884a4f12de11f54d4ca67a07dd1f111d96fdbd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GEVR
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git/c…
--------------------------------
When kunpeng920 encryption driver is used to deencrypt and decrypt
packets during the softirq, it is not allowed to use mutex lock. The
kernel will report the following error:
BUG: scheduling while atomic: swapper/57/0/0x00000300
Call trace:
dump_backtrace+0x0/0x1e4
show_stack+0x20/0x2c
dump_stack+0xd8/0x140
__schedule_bug+0x68/0x80
__schedule+0x728/0x840
schedule+0x50/0xe0
schedule_preempt_disabled+0x18/0x24
__mutex_lock.constprop.0+0x594/0x5dc
__mutex_lock_slowpath+0x1c/0x30
mutex_lock+0x50/0x60
sec_request_init+0x8c/0x1a0 [hisi_sec2]
sec_process+0x28/0x1ac [hisi_sec2]
sec_skcipher_crypto+0xf4/0x1d4 [hisi_sec2]
sec_skcipher_encrypt+0x1c/0x30 [hisi_sec2]
crypto_skcipher_encrypt+0x2c/0x40
crypto_authenc_encrypt+0xc8/0xfc [authenc]
crypto_aead_encrypt+0x2c/0x40
echainiv_encrypt+0x144/0x1a0 [echainiv]
crypto_aead_encrypt+0x2c/0x40
esp_output_tail+0x348/0x5c0 [esp4]
esp_output+0x120/0x19c [esp4]
xfrm_output_one+0x25c/0x4d4
xfrm_output_resume+0x6c/0x1fc
xfrm_output+0xac/0x3c0
xfrm4_output+0x64/0x130
ip_build_and_send_pkt+0x158/0x20c
tcp_v4_send_synack+0xdc/0x1f0
tcp_conn_request+0x7d0/0x994
tcp_v4_conn_request+0x58/0x6c
tcp_v6_conn_request+0xf0/0x100
tcp_rcv_state_process+0x1cc/0xd60
tcp_v4_do_rcv+0x10c/0x250
tcp_v4_rcv+0xfc4/0x10a4
ip_protocol_deliver_rcu+0xf4/0x200
ip_local_deliver_finish+0x58/0x70
ip_local_deliver+0x68/0x120
ip_sublist_rcv_finish+0x70/0x94
ip_list_rcv_finish.constprop.0+0x17c/0x1d0
ip_sublist_rcv+0x40/0xb0
ip_list_rcv+0x140/0x1dc
__netif_receive_skb_list_core+0x154/0x28c
__netif_receive_skb_list+0x120/0x1a0
netif_receive_skb_list_internal+0xe4/0x1f0
napi_complete_done+0x70/0x1f0
gro_cell_poll+0x9c/0xb0
napi_poll+0xcc/0x264
net_rx_action+0xd4/0x21c
__do_softirq+0x130/0x358
irq_exit+0x11c/0x13c
__handle_domain_irq+0x88/0xf0
gic_handle_irq+0x78/0x2c0
el1_irq+0xb8/0x140
arch_cpu_idle+0x18/0x40
default_idle_call+0x5c/0x1c0
cpuidle_idle_call+0x174/0x1b0
do_idle+0xc8/0x160
cpu_startup_entry+0x30/0x11c
secondary_start_kernel+0x158/0x1e4
softirq: huh, entered softirq 3 NET_RX 0000000093774ee4 with
preempt_count 00000100, exited with fffffe00?
Fixes: 416d82204df4 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
Signed-off-by: Zhengchao Shao <shaozhengchao(a)huawei.com>
Signed-off-by: Herbert Xu <herbert(a)gondor.apana.org.au>
Reviewed-by: Wei Yongjun <weiyongjun1(a)huawei.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
---
drivers/crypto/hisilicon/sec2/sec.h | 2 +-
drivers/crypto/hisilicon/sec2/sec_crypto.c | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/crypto/hisilicon/sec2/sec.h b/drivers/crypto/hisilicon/sec2/sec.h
index d97cf02b1df7..cff00fd29765 100644
--- a/drivers/crypto/hisilicon/sec2/sec.h
+++ b/drivers/crypto/hisilicon/sec2/sec.h
@@ -119,7 +119,7 @@ struct sec_qp_ctx {
struct idr req_idr;
struct sec_alg_res res[QM_Q_DEPTH];
struct sec_ctx *ctx;
- struct mutex req_lock;
+ spinlock_t req_lock;
struct list_head backlog;
struct hisi_acc_sgl_pool *c_in_pool;
struct hisi_acc_sgl_pool *c_out_pool;
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index 9d0a39f60fb2..b2228a935dcd 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -127,11 +127,11 @@ static int sec_alloc_req_id(struct sec_req *req, struct sec_qp_ctx *qp_ctx)
{
int req_id;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
req_id = idr_alloc_cyclic(&qp_ctx->req_idr, NULL,
0, QM_Q_DEPTH, GFP_ATOMIC);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
if (unlikely(req_id < 0)) {
dev_err(req->ctx->dev, "alloc req id fail!\n");
return req_id;
@@ -156,9 +156,9 @@ static void sec_free_req_id(struct sec_req *req)
qp_ctx->req_list[req_id] = NULL;
req->qp_ctx = NULL;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
idr_remove(&qp_ctx->req_idr, req_id);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
}
static u8 pre_parse_finished_bd(struct bd_status *status, void *resp)
@@ -273,7 +273,7 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)
!(req->flag & CRYPTO_TFM_REQ_MAY_BACKLOG))
return -EBUSY;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe);
if (ctx->fake_req_limit <=
@@ -281,10 +281,10 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)
list_add_tail(&req->backlog_head, &qp_ctx->backlog);
atomic64_inc(&ctx->sec->debug.dfx.send_cnt);
atomic64_inc(&ctx->sec->debug.dfx.send_busy_cnt);
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
return -EBUSY;
}
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
if (unlikely(ret == -EBUSY))
return -ENOBUFS;
@@ -487,7 +487,7 @@ static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,
qp->req_cb = sec_req_cb;
- mutex_init(&qp_ctx->req_lock);
+ spin_lock_init(&qp_ctx->req_lock);
idr_init(&qp_ctx->req_idr);
INIT_LIST_HEAD(&qp_ctx->backlog);
@@ -1382,7 +1382,7 @@ static struct sec_req *sec_back_req_clear(struct sec_ctx *ctx,
{
struct sec_req *backlog_req = NULL;
- mutex_lock(&qp_ctx->req_lock);
+ spin_lock_bh(&qp_ctx->req_lock);
if (ctx->fake_req_limit >=
atomic_read(&qp_ctx->qp->qp_status.used) &&
!list_empty(&qp_ctx->backlog)) {
@@ -1390,7 +1390,7 @@ static struct sec_req *sec_back_req_clear(struct sec_ctx *ctx,
typeof(*backlog_req), backlog_head);
list_del(&backlog_req->backlog_head);
}
- mutex_unlock(&qp_ctx->req_lock);
+ spin_unlock_bh(&qp_ctx->req_lock);
return backlog_req;
}
--
2.20.1
1
4

[PATCH openEuler-5.10 01/46] Driver for Zhaoxin CPU core temperature monitoring
by Zheng Zengkai 19 Jul '22
by Zheng Zengkai 19 Jul '22
19 Jul '22
From: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
zhaoxin inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I52DS7
CVE: NA
--------------------------------------------
Add support for the temperature sensor inside CPU.
Supported are all known variants of the Zhaoxin processors.
v1: Fix some character encoding mistaken.
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
Reviewed-by: Xiongfeng Wang <wangxiongfeng2(a)huawei.com>
---
drivers/hwmon/Kconfig | 9 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/via-cputemp.c | 1 -
drivers/hwmon/zhaoxin-cputemp.c | 292 ++++++++++++++++++++++++++++++++
4 files changed, 302 insertions(+), 1 deletion(-)
create mode 100644 drivers/hwmon/zhaoxin-cputemp.c
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 45a1a5969d01..f2fe56e6f8bd 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1899,6 +1899,15 @@ config SENSORS_VIA_CPUTEMP
sensor inside your CPU. Supported are all known variants of
the VIA C7 and Nano.
+config SENSORS_ZHAOXIN_CPUTEMP
+ tristate "Zhaoxin CPU temperature sensor"
+ depends on X86
+ select HWMON_VID
+ help
+ If you say yes here you get support for the temperature
+ sensor inside your CPU. Supported are all known variants of
+ the Zhaoxin processors.
+
config SENSORS_VIA686A
tristate "VIA686A"
depends on PCI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index c22a5316bd91..95908c478b94 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -184,6 +184,7 @@ obj-$(CONFIG_SENSORS_TMP421) += tmp421.o
obj-$(CONFIG_SENSORS_TMP513) += tmp513.o
obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress-hwmon.o
obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+= via-cputemp.o
+obj-$(CONFIG_SENSORS_ZHAOXIN_CPUTEMP) += zhaoxin-cputemp.o
obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
obj-$(CONFIG_SENSORS_VT1211) += vt1211.o
obj-$(CONFIG_SENSORS_VT8231) += vt8231.o
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index e5d18dac8ee7..0a5057dbe51a 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -273,7 +273,6 @@ static const struct x86_cpu_id __initconst cputemp_ids[] = {
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A, NULL),
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D, NULL),
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO, NULL),
- X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY, NULL),
{}
};
MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
diff --git a/drivers/hwmon/zhaoxin-cputemp.c b/drivers/hwmon/zhaoxin-cputemp.c
new file mode 100644
index 000000000000..39e729590eba
--- /dev/null
+++ b/drivers/hwmon/zhaoxin-cputemp.c
@@ -0,0 +1,292 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * zhaoxin-cputemp.c - Driver for Zhaoxin CPU core temperature monitoring
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-vid.h>
+#include <linux/sysfs.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/list.h>
+#include <linux/platform_device.h>
+#include <linux/cpu.h>
+#include <asm/msr.h>
+#include <asm/processor.h>
+#include <asm/cpu_device_id.h>
+
+#define DRVNAME "zhaoxin_cputemp"
+
+enum { SHOW_TEMP, SHOW_LABEL, SHOW_NAME };
+
+/* Functions declaration */
+
+struct zhaoxin_cputemp_data {
+ struct device *hwmon_dev;
+ const char *name;
+ u8 vrm;
+ u32 id;
+ u32 msr_temp;
+ u32 msr_vid;
+};
+
+/* Sysfs stuff */
+
+static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
+ char *buf)
+{
+ int ret;
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+
+ if (attr->index == SHOW_NAME)
+ ret = sprintf(buf, "%s\n", data->name);
+ else /* show label */
+ ret = sprintf(buf, "Core %d\n", data->id);
+ return ret;
+}
+
+static ssize_t temp_show(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+ u32 eax, edx;
+ int err;
+
+ err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
+ if (err)
+ return -EAGAIN;
+
+ return sprintf(buf, "%lu\n", ((unsigned long)eax & 0xffffff) * 1000);
+}
+
+static ssize_t cpu0_vid_show(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+ u32 eax, edx;
+ int err;
+
+ err = rdmsr_safe_on_cpu(data->id, data->msr_vid, &eax, &edx);
+ if (err)
+ return -EAGAIN;
+
+ return sprintf(buf, "%d\n", vid_from_reg(~edx & 0x7f, data->vrm));
+}
+
+static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, SHOW_TEMP);
+static SENSOR_DEVICE_ATTR_RO(temp1_label, name, SHOW_LABEL);
+static SENSOR_DEVICE_ATTR_RO(name, name, SHOW_NAME);
+
+static struct attribute *zhaoxin_cputemp_attributes[] = {
+ &sensor_dev_attr_name.dev_attr.attr,
+ &sensor_dev_attr_temp1_label.dev_attr.attr,
+ &sensor_dev_attr_temp1_input.dev_attr.attr,
+ NULL
+};
+
+static const struct attribute_group zhaoxin_cputemp_group = {
+ .attrs = zhaoxin_cputemp_attributes,
+};
+
+/* Optional attributes */
+static DEVICE_ATTR_RO(cpu0_vid);
+
+static int zhaoxin_cputemp_probe(struct platform_device *pdev)
+{
+ struct zhaoxin_cputemp_data *data;
+ int err;
+ u32 eax, edx;
+
+ data = devm_kzalloc(&pdev->dev, sizeof(struct zhaoxin_cputemp_data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->id = pdev->id;
+ data->name = "zhaoxin_cputemp";
+ data->msr_temp = 0x1423;
+
+ /* test if we can access the TEMPERATURE MSR */
+ err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
+ if (err) {
+ dev_err(&pdev->dev, "Unable to access TEMPERATURE MSR, giving up\n");
+ return err;
+ }
+
+ platform_set_drvdata(pdev, data);
+
+ err = sysfs_create_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ if (err)
+ return err;
+
+ if (data->msr_vid)
+ data->vrm = vid_which_vrm();
+
+ if (data->vrm) {
+ err = device_create_file(&pdev->dev, &dev_attr_cpu0_vid);
+ if (err)
+ goto exit_remove;
+ }
+
+ data->hwmon_dev = hwmon_device_register(&pdev->dev);
+ if (IS_ERR(data->hwmon_dev)) {
+ err = PTR_ERR(data->hwmon_dev);
+ dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
+ goto exit_remove;
+ }
+
+ return 0;
+
+exit_remove:
+ if (data->vrm)
+ device_remove_file(&pdev->dev, &dev_attr_cpu0_vid);
+ sysfs_remove_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ return err;
+}
+
+static int zhaoxin_cputemp_remove(struct platform_device *pdev)
+{
+ struct zhaoxin_cputemp_data *data = platform_get_drvdata(pdev);
+
+ hwmon_device_unregister(data->hwmon_dev);
+ if (data->vrm)
+ device_remove_file(&pdev->dev, &dev_attr_cpu0_vid);
+ sysfs_remove_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ return 0;
+}
+
+static struct platform_driver zhaoxin_cputemp_driver = {
+ .driver = {
+ .name = DRVNAME,
+ },
+ .probe = zhaoxin_cputemp_probe,
+ .remove = zhaoxin_cputemp_remove,
+};
+
+struct pdev_entry {
+ struct list_head list;
+ struct platform_device *pdev;
+ unsigned int cpu;
+};
+
+static LIST_HEAD(pdev_list);
+static DEFINE_MUTEX(pdev_list_mutex);
+
+static int zhaoxin_cputemp_online(unsigned int cpu)
+{
+ int err;
+ struct platform_device *pdev;
+ struct pdev_entry *pdev_entry;
+
+ pdev = platform_device_alloc(DRVNAME, cpu);
+ if (!pdev) {
+ err = -ENOMEM;
+ pr_err("Device allocation failed\n");
+ goto exit;
+ }
+
+ pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL);
+ if (!pdev_entry) {
+ err = -ENOMEM;
+ goto exit_device_put;
+ }
+
+ err = platform_device_add(pdev);
+ if (err) {
+ pr_err("Device addition failed (%d)\n", err);
+ goto exit_device_free;
+ }
+
+ pdev_entry->pdev = pdev;
+ pdev_entry->cpu = cpu;
+ mutex_lock(&pdev_list_mutex);
+ list_add_tail(&pdev_entry->list, &pdev_list);
+ mutex_unlock(&pdev_list_mutex);
+
+ return 0;
+
+exit_device_free:
+ kfree(pdev_entry);
+exit_device_put:
+ platform_device_put(pdev);
+exit:
+ return err;
+}
+
+static int zhaoxin_cputemp_down_prep(unsigned int cpu)
+{
+ struct pdev_entry *p;
+
+ mutex_lock(&pdev_list_mutex);
+ list_for_each_entry(p, &pdev_list, list) {
+ if (p->cpu == cpu) {
+ platform_device_unregister(p->pdev);
+ list_del(&p->list);
+ mutex_unlock(&pdev_list_mutex);
+ kfree(p);
+ return 0;
+ }
+ }
+ mutex_unlock(&pdev_list_mutex);
+ return 0;
+}
+
+static const struct x86_cpu_id __initconst cputemp_ids[] = {
+ X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY, NULL),
+ X86_MATCH_VENDOR_FAM_MODEL(ZHAOXIN, 7, X86_MODEL_ANY, NULL),
+ {}
+};
+MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
+
+static enum cpuhp_state zhaoxin_temp_online;
+
+static int __init zhaoxin_cputemp_init(void)
+{
+ int err;
+
+ if (!x86_match_cpu(cputemp_ids))
+ return -ENODEV;
+
+ err = platform_driver_register(&zhaoxin_cputemp_driver);
+ if (err)
+ goto exit;
+
+ err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "hwmon/zhaoxin:online",
+ zhaoxin_cputemp_online, zhaoxin_cputemp_down_prep);
+ if (err < 0)
+ goto exit_driver_unreg;
+ zhaoxin_temp_online = err;
+
+#ifndef CONFIG_HOTPLUG_CPU
+ if (list_empty(&pdev_list)) {
+ err = -ENODEV;
+ goto exit_hp_unreg;
+ }
+#endif
+ return 0;
+
+#ifndef CONFIG_HOTPLUG_CPU
+exit_hp_unreg:
+ cpuhp_remove_state_nocalls(zhaoxin_temp_online);
+#endif
+exit_driver_unreg:
+ platform_driver_unregister(&zhaoxin_cputemp_driver);
+exit:
+ return err;
+}
+
+static void __exit zhaoxin_cputemp_exit(void)
+{
+ cpuhp_remove_state(zhaoxin_temp_online);
+ platform_driver_unregister(&zhaoxin_cputemp_driver);
+}
+
+MODULE_DESCRIPTION("Zhaoxin CPU temperature monitor");
+MODULE_LICENSE("GPL");
+
+module_init(zhaoxin_cputemp_init)
+module_exit(zhaoxin_cputemp_exit)
--
2.20.1
1
45

[PATCH openEuler-5.10-LTS 01/10] Driver for Zhaoxin CPU core temperature monitoring
by Zheng Zengkai 19 Jul '22
by Zheng Zengkai 19 Jul '22
19 Jul '22
From: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
zhaoxin inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I52DS7
CVE: NA
--------------------------------------------
Add support for the temperature sensor inside CPU.
Supported are all known variants of the Zhaoxin processors.
v1: Fix some character encoding mistaken.
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
Reviewed-by: Xiongfeng Wang <wangxiongfeng2(a)huawei.com>
---
drivers/hwmon/Kconfig | 9 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/via-cputemp.c | 1 -
drivers/hwmon/zhaoxin-cputemp.c | 292 ++++++++++++++++++++++++++++++++
4 files changed, 302 insertions(+), 1 deletion(-)
create mode 100644 drivers/hwmon/zhaoxin-cputemp.c
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 45a1a5969d01..f2fe56e6f8bd 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1899,6 +1899,15 @@ config SENSORS_VIA_CPUTEMP
sensor inside your CPU. Supported are all known variants of
the VIA C7 and Nano.
+config SENSORS_ZHAOXIN_CPUTEMP
+ tristate "Zhaoxin CPU temperature sensor"
+ depends on X86
+ select HWMON_VID
+ help
+ If you say yes here you get support for the temperature
+ sensor inside your CPU. Supported are all known variants of
+ the Zhaoxin processors.
+
config SENSORS_VIA686A
tristate "VIA686A"
depends on PCI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index c22a5316bd91..95908c478b94 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -184,6 +184,7 @@ obj-$(CONFIG_SENSORS_TMP421) += tmp421.o
obj-$(CONFIG_SENSORS_TMP513) += tmp513.o
obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress-hwmon.o
obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+= via-cputemp.o
+obj-$(CONFIG_SENSORS_ZHAOXIN_CPUTEMP) += zhaoxin-cputemp.o
obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
obj-$(CONFIG_SENSORS_VT1211) += vt1211.o
obj-$(CONFIG_SENSORS_VT8231) += vt8231.o
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index e5d18dac8ee7..0a5057dbe51a 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -273,7 +273,6 @@ static const struct x86_cpu_id __initconst cputemp_ids[] = {
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A, NULL),
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D, NULL),
X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO, NULL),
- X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY, NULL),
{}
};
MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
diff --git a/drivers/hwmon/zhaoxin-cputemp.c b/drivers/hwmon/zhaoxin-cputemp.c
new file mode 100644
index 000000000000..39e729590eba
--- /dev/null
+++ b/drivers/hwmon/zhaoxin-cputemp.c
@@ -0,0 +1,292 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * zhaoxin-cputemp.c - Driver for Zhaoxin CPU core temperature monitoring
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-vid.h>
+#include <linux/sysfs.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/err.h>
+#include <linux/mutex.h>
+#include <linux/list.h>
+#include <linux/platform_device.h>
+#include <linux/cpu.h>
+#include <asm/msr.h>
+#include <asm/processor.h>
+#include <asm/cpu_device_id.h>
+
+#define DRVNAME "zhaoxin_cputemp"
+
+enum { SHOW_TEMP, SHOW_LABEL, SHOW_NAME };
+
+/* Functions declaration */
+
+struct zhaoxin_cputemp_data {
+ struct device *hwmon_dev;
+ const char *name;
+ u8 vrm;
+ u32 id;
+ u32 msr_temp;
+ u32 msr_vid;
+};
+
+/* Sysfs stuff */
+
+static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
+ char *buf)
+{
+ int ret;
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+
+ if (attr->index == SHOW_NAME)
+ ret = sprintf(buf, "%s\n", data->name);
+ else /* show label */
+ ret = sprintf(buf, "Core %d\n", data->id);
+ return ret;
+}
+
+static ssize_t temp_show(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+ u32 eax, edx;
+ int err;
+
+ err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
+ if (err)
+ return -EAGAIN;
+
+ return sprintf(buf, "%lu\n", ((unsigned long)eax & 0xffffff) * 1000);
+}
+
+static ssize_t cpu0_vid_show(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+ struct zhaoxin_cputemp_data *data = dev_get_drvdata(dev);
+ u32 eax, edx;
+ int err;
+
+ err = rdmsr_safe_on_cpu(data->id, data->msr_vid, &eax, &edx);
+ if (err)
+ return -EAGAIN;
+
+ return sprintf(buf, "%d\n", vid_from_reg(~edx & 0x7f, data->vrm));
+}
+
+static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, SHOW_TEMP);
+static SENSOR_DEVICE_ATTR_RO(temp1_label, name, SHOW_LABEL);
+static SENSOR_DEVICE_ATTR_RO(name, name, SHOW_NAME);
+
+static struct attribute *zhaoxin_cputemp_attributes[] = {
+ &sensor_dev_attr_name.dev_attr.attr,
+ &sensor_dev_attr_temp1_label.dev_attr.attr,
+ &sensor_dev_attr_temp1_input.dev_attr.attr,
+ NULL
+};
+
+static const struct attribute_group zhaoxin_cputemp_group = {
+ .attrs = zhaoxin_cputemp_attributes,
+};
+
+/* Optional attributes */
+static DEVICE_ATTR_RO(cpu0_vid);
+
+static int zhaoxin_cputemp_probe(struct platform_device *pdev)
+{
+ struct zhaoxin_cputemp_data *data;
+ int err;
+ u32 eax, edx;
+
+ data = devm_kzalloc(&pdev->dev, sizeof(struct zhaoxin_cputemp_data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ data->id = pdev->id;
+ data->name = "zhaoxin_cputemp";
+ data->msr_temp = 0x1423;
+
+ /* test if we can access the TEMPERATURE MSR */
+ err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
+ if (err) {
+ dev_err(&pdev->dev, "Unable to access TEMPERATURE MSR, giving up\n");
+ return err;
+ }
+
+ platform_set_drvdata(pdev, data);
+
+ err = sysfs_create_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ if (err)
+ return err;
+
+ if (data->msr_vid)
+ data->vrm = vid_which_vrm();
+
+ if (data->vrm) {
+ err = device_create_file(&pdev->dev, &dev_attr_cpu0_vid);
+ if (err)
+ goto exit_remove;
+ }
+
+ data->hwmon_dev = hwmon_device_register(&pdev->dev);
+ if (IS_ERR(data->hwmon_dev)) {
+ err = PTR_ERR(data->hwmon_dev);
+ dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
+ goto exit_remove;
+ }
+
+ return 0;
+
+exit_remove:
+ if (data->vrm)
+ device_remove_file(&pdev->dev, &dev_attr_cpu0_vid);
+ sysfs_remove_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ return err;
+}
+
+static int zhaoxin_cputemp_remove(struct platform_device *pdev)
+{
+ struct zhaoxin_cputemp_data *data = platform_get_drvdata(pdev);
+
+ hwmon_device_unregister(data->hwmon_dev);
+ if (data->vrm)
+ device_remove_file(&pdev->dev, &dev_attr_cpu0_vid);
+ sysfs_remove_group(&pdev->dev.kobj, &zhaoxin_cputemp_group);
+ return 0;
+}
+
+static struct platform_driver zhaoxin_cputemp_driver = {
+ .driver = {
+ .name = DRVNAME,
+ },
+ .probe = zhaoxin_cputemp_probe,
+ .remove = zhaoxin_cputemp_remove,
+};
+
+struct pdev_entry {
+ struct list_head list;
+ struct platform_device *pdev;
+ unsigned int cpu;
+};
+
+static LIST_HEAD(pdev_list);
+static DEFINE_MUTEX(pdev_list_mutex);
+
+static int zhaoxin_cputemp_online(unsigned int cpu)
+{
+ int err;
+ struct platform_device *pdev;
+ struct pdev_entry *pdev_entry;
+
+ pdev = platform_device_alloc(DRVNAME, cpu);
+ if (!pdev) {
+ err = -ENOMEM;
+ pr_err("Device allocation failed\n");
+ goto exit;
+ }
+
+ pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL);
+ if (!pdev_entry) {
+ err = -ENOMEM;
+ goto exit_device_put;
+ }
+
+ err = platform_device_add(pdev);
+ if (err) {
+ pr_err("Device addition failed (%d)\n", err);
+ goto exit_device_free;
+ }
+
+ pdev_entry->pdev = pdev;
+ pdev_entry->cpu = cpu;
+ mutex_lock(&pdev_list_mutex);
+ list_add_tail(&pdev_entry->list, &pdev_list);
+ mutex_unlock(&pdev_list_mutex);
+
+ return 0;
+
+exit_device_free:
+ kfree(pdev_entry);
+exit_device_put:
+ platform_device_put(pdev);
+exit:
+ return err;
+}
+
+static int zhaoxin_cputemp_down_prep(unsigned int cpu)
+{
+ struct pdev_entry *p;
+
+ mutex_lock(&pdev_list_mutex);
+ list_for_each_entry(p, &pdev_list, list) {
+ if (p->cpu == cpu) {
+ platform_device_unregister(p->pdev);
+ list_del(&p->list);
+ mutex_unlock(&pdev_list_mutex);
+ kfree(p);
+ return 0;
+ }
+ }
+ mutex_unlock(&pdev_list_mutex);
+ return 0;
+}
+
+static const struct x86_cpu_id __initconst cputemp_ids[] = {
+ X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY, NULL),
+ X86_MATCH_VENDOR_FAM_MODEL(ZHAOXIN, 7, X86_MODEL_ANY, NULL),
+ {}
+};
+MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
+
+static enum cpuhp_state zhaoxin_temp_online;
+
+static int __init zhaoxin_cputemp_init(void)
+{
+ int err;
+
+ if (!x86_match_cpu(cputemp_ids))
+ return -ENODEV;
+
+ err = platform_driver_register(&zhaoxin_cputemp_driver);
+ if (err)
+ goto exit;
+
+ err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "hwmon/zhaoxin:online",
+ zhaoxin_cputemp_online, zhaoxin_cputemp_down_prep);
+ if (err < 0)
+ goto exit_driver_unreg;
+ zhaoxin_temp_online = err;
+
+#ifndef CONFIG_HOTPLUG_CPU
+ if (list_empty(&pdev_list)) {
+ err = -ENODEV;
+ goto exit_hp_unreg;
+ }
+#endif
+ return 0;
+
+#ifndef CONFIG_HOTPLUG_CPU
+exit_hp_unreg:
+ cpuhp_remove_state_nocalls(zhaoxin_temp_online);
+#endif
+exit_driver_unreg:
+ platform_driver_unregister(&zhaoxin_cputemp_driver);
+exit:
+ return err;
+}
+
+static void __exit zhaoxin_cputemp_exit(void)
+{
+ cpuhp_remove_state(zhaoxin_temp_online);
+ platform_driver_unregister(&zhaoxin_cputemp_driver);
+}
+
+MODULE_DESCRIPTION("Zhaoxin CPU temperature monitor");
+MODULE_LICENSE("GPL");
+
+module_init(zhaoxin_cputemp_init)
+module_exit(zhaoxin_cputemp_exit)
--
2.20.1
1
9
Backport 5.10.112 LTS patches from upstream.
git cherry-pick v5.10.111..v5.10.112~1 -s
Complicts:
Already merged(10):
80a4df14643f7 hamradio: defer 6pack kfree after unregister_netdev
cfa98ffc42f16 hamradio: remove needs_free_netdev to avoid UAF
5ea00fc60676 ax25: add refcount in ax25_dev to avoid UAF bugs
5ddae8d06441 ax25: fix reference count leaks of ax25_dev
57cc15f5fd55 ax25: fix UAF bugs of net_device caused by rebinding operation
b20a5ab0f5fb ax25: Fix refcount leaks caused by ax25_cb_del()
a4942c6fea87 ax25: fix UAF bug in ax25_send_control()
145ea8d213e8 ax25: fix NPD bug in ax25_disconnect
f934fa478dd1 ax25: Fix NULL pointer dereferences in ax25 timers
5c62d3bf1410 ax25: Fix UAF bugs in ax25 timers
Rejected(1, KABI changed and hard to fix):
845f44ce3d9f net/sched: flower: fix parsing of ethertype following VLAN header
KABI fixes(2):
scsi: iscsi: fix kabi broken in struct iscsi_cls_conn
scsi: iscsi: fix kabi broken in struct iscsi_transport
Total patches: 104 - 10 - 1 + 2 = 95
Adrian Hunter (1):
perf tools: Fix misleading add event PMU debug message
Ajish Koshy (2):
scsi: pm80xx: Mask and unmask upper interrupt vectors 32-63
scsi: pm80xx: Enable upper inbound, outbound queues
Alexey Galakhov (1):
scsi: mvsas: Add PCI ID of RocketRaid 2640
Andy Chiu (1):
net: axienet: setup mdio unconditionally
Anna-Maria Behnsen (1):
timers: Fix warning condition in __run_timers()
Athira Rajeev (1):
testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu
set
Aurabindo Pillai (1):
drm/amd: Add USBC connector ID
Benedikt Spranger (1):
net/sched: taprio: Check if socket flags are valid
Borislav Petkov (1):
perf/imx_ddr: Fix undefined behavior due to shift overflowing the
constant
Calvin Johnson (1):
net: mdio: Alphabetically sort header inclusion
Chandrakanth patil (1):
scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan
Chao Gao (1):
dma-direct: avoid redundant memory sync for swiotlb
Charlene Liu (1):
drm/amd/display: fix audio format not updated after edid updated
Chiawen Huang (1):
drm/amd/display: FEC check in timing validation
Christian Lamparter (1):
ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs
Chuck Lever (1):
SUNRPC: Fix the svc_deferred_event trace class
Cristian Marussi (1):
firmware: arm_scmi: Fix sorting of retrieved clock rates
Darrick J. Wong (1):
btrfs: fix fallocate to use file_modified to update permissions
consistently
Dinh Nguyen (1):
net: ethernet: stmmac: fix altr_tse_pcs function when using a
fixed-link
Duoming Zhou (1):
drivers: net: slip: fix NPD bug in sl_tx_timeout()
Fabio M. De Francesco (1):
ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
Felix Kuehling (1):
drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu
Guillaume Nault (1):
veth: Ensure eth header is in skb's linear part
Harshit Mogalapalli (1):
cifs: potential buffer overflow in handling symlinks
James Smart (1):
scsi: lpfc: Fix queue failures when recovering from PCI parity error
Jason A. Donenfeld (1):
gcc-plugins: latent_entropy: use /dev/urandom
Jeremy Linton (1):
net: bcmgenet: Revert "Use stronger register read/writes to assure
ordering"
Jia-Ju Bai (1):
btrfs: fix root ref counts in error handling in btrfs_get_root_ref
Joey Gouly (1):
arm64: alternatives: mark patch_alternative() as `noinstr`
Johan Hovold (1):
memory: renesas-rpc-if: fix platform-device leak in error path
Johannes Berg (1):
nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size
Jonathan Bakker (1):
regulator: wm8994: Add an off-on delay for WM8994 variant
Josef Bacik (1):
btrfs: do not warn for free space inode in cow_file_range
Juergen Gross (1):
mm, page_alloc: fix build_zonerefs_node()
Karsten Graul (1):
net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()
Khazhismel Kumykov (1):
dm mpath: only use ktime_get_ns() in historical selector
Kyle Copperfield (1):
media: rockchip/rga: do proper error checking in probe
Leo (Hanghong) Ma (1):
drm/amd/display: Update VTEM Infopacket definition
Leo Ruan (1):
gpu: ipu-v3: Fix dev_dbg frequency output
Li Nan (1):
scsi: iscsi: fix kabi broken in struct iscsi_transport
Lin Ma (1):
nfc: nci: add flush_workqueue to prevent uaf
Linus Torvalds (1):
gpiolib: acpi: use correct format characters
Marcelo Ricardo Leitner (1):
net/sched: fix initialization order when updating chain 0 head
Marcin Kozlowski (1):
net: usb: aqc111: Fix out-of-bounds accesses in RX fixup
Mario Limonciello (2):
cpuidle: PSCI: Move the `has_lpi` check to the beginning of the
function
ACPI: processor idle: Check for architectural support for LPI
Martin Leung (1):
drm/amd/display: Revert FEC check in validation
Martin Povišer (1):
i2c: pasemi: Wait for write xfers to finish
Melissa Wen (1):
drm/amd/display: don't ignore alpha property on pre-multiplied mode
Miaoqian Lin (1):
memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe
Michael Kelley (1):
Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer
Michael Walle (1):
net: dsa: felix: suppress -EPROBE_DEFER errors
Mike Christie (10):
scsi: iscsi: Stop queueing during ep_disconnect
scsi: iscsi: Force immediate failure during shutdown
scsi: iscsi: Use system_unbound_wq for destroy_work
scsi: iscsi: Rel ref after iscsi_lookup_endpoint()
scsi: iscsi: Fix in-kernel conn failure handling
scsi: iscsi: Move iscsi_ep_disconnect()
scsi: iscsi: Fix offload conn cleanup when iscsid restarts
scsi: iscsi: Fix conn cleanup and stop race during iscsid restart
scsi: iscsi: Fix endpoint reuse regression
scsi: iscsi: Fix unbound endpoint error handling
Mikulas Patocka (1):
dm integrity: fix memory corruption when tag_size is less than digest
size
Minchan Kim (1):
mm: fix unexpected zeroed page mapping with zram swap
Nadav Amit (1):
smp: Fix offline cpu check in flush_smp_call_function_queue()
Naohiro Aota (1):
btrfs: mark resumed async balance as writing
Nathan Chancellor (2):
btrfs: remove unused variable in
btrfs_{start,write}_dirty_block_groups()
ARM: davinci: da850-evm: Avoid NULL pointer dereference
Nicolas Dichtel (1):
ipv6: fix panic when forwarding a pkt with no in6 dev
Patrick Wang (1):
mm: kmemleak: take a full lowmem check in kmemleak_*_phys()
Paul Gortmaker (1):
tick/nohz: Use WARN_ON_ONCE() to prevent console saturation
Petr Malat (1):
sctp: Initialize daddr on peeled off socket
QintaoShen (1):
drm/amdkfd: Check for potential null return of kmalloc_array()
Rameshkumar Sundaram (1):
cfg80211: hold bss_lock while updating nontrans_list
Randy Dunlap (1):
net: micrel: fix KS8851_MLL Kconfig
Rei Yamamoto (1):
genirq/affinity: Consider that CPUs on nodes can be unbalanced
Rob Clark (2):
drm/msm: Add missing put_task_struct() in debugfs path
drm/msm: Fix range size vs end confusion
Roman Li (1):
drm/amd/display: Fix allocate_mst_payload assert on resume
Sean Christopherson (1):
KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded
Stephen Boyd (1):
drm/msm/dsi: Use connector directly in
msm_dsi_manager_connector_init()
Steve Capper (1):
tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry
Tao Jin (1):
ALSA: hda/realtek: add quirk for Lenovo Thinkpad X12 speakers
Tianci Yin (1):
drm/amdgpu/vcn: improve vcn dpg stop procedure
Tim Crawford (1):
ALSA: hda/realtek: Add quirk for Clevo PD50PNT
Toke Høiland-Jørgensen (2):
ath9k: Properly clear TX status area before reporting to mac80211
ath9k: Fix usage of driver-private space in tx_info
Tomasz Moń (1):
drm/amdgpu: Enable gfxoff quirk on MacBook Pro
Tushar Patel (1):
drm/amdkfd: Fix Incorrect VMIDs passed to HWS
Tyrel Datwyler (1):
scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024
Vadim Pasternak (1):
mlxsw: i2c: Fix initialization error flow
Xiaoguang Wang (1):
scsi: target: tcmu: Fix possible page UAF
Xiaomeng Tong (1):
myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
Zhang Wensheng (1):
scsi: iscsi: fix kabi broken in struct iscsi_cls_conn
arch/arm/mach-davinci/board-da850-evm.c | 4 +-
arch/arm64/kernel/alternative.c | 6 +-
arch/arm64/kernel/cpuidle.c | 6 +-
arch/x86/include/asm/kvm_host.h | 5 +-
arch/x86/kvm/mmu/mmu.c | 20 +-
arch/x86/kvm/x86.c | 20 +-
drivers/acpi/processor_idle.c | 15 +-
drivers/ata/libata-core.c | 3 +
drivers/firmware/arm_scmi/clock.c | 3 +-
drivers/gpio/gpiolib-acpi.c | 4 +-
drivers/gpu/drm/amd/amdgpu/ObjectID.h | 1 +
.../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 11 +-
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 4 +-
.../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +-
.../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 14 +-
.../display/modules/info_packet/info_packet.c | 5 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +-
drivers/gpu/drm/msm/msm_gem.c | 1 +
drivers/gpu/ipu-v3/ipu-di.c | 5 +-
drivers/hv/ring_buffer.c | 11 +-
drivers/i2c/busses/i2c-pasemi.c | 6 +
drivers/infiniband/ulp/iser/iscsi_iser.c | 9 +-
drivers/md/dm-historical-service-time.c | 10 +-
drivers/md/dm-integrity.c | 7 +-
drivers/media/platform/rockchip/rga/rga.c | 2 +-
drivers/memory/atmel-ebi.c | 23 +-
drivers/memory/renesas-rpc-if.c | 10 +-
drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +-
.../net/ethernet/broadcom/genet/bcmgenet.c | 4 +-
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 1 +
drivers/net/ethernet/micrel/Kconfig | 1 +
.../net/ethernet/myricom/myri10ge/myri10ge.c | 6 +-
.../ethernet/stmicro/stmmac/altr_tse_pcs.c | 8 -
.../ethernet/stmicro/stmmac/altr_tse_pcs.h | 4 +
.../ethernet/stmicro/stmmac/dwmac-socfpga.c | 13 +-
.../net/ethernet/xilinx/xilinx_axienet_main.c | 13 +-
drivers/net/mdio/mdio-bcm-unimac.c | 16 +-
drivers/net/mdio/mdio-bitbang.c | 4 +-
drivers/net/mdio/mdio-cavium.c | 2 +-
drivers/net/mdio/mdio-gpio.c | 10 +-
drivers/net/mdio/mdio-ipq4019.c | 4 +-
drivers/net/mdio/mdio-ipq8064.c | 4 +-
drivers/net/mdio/mdio-mscc-miim.c | 8 +-
drivers/net/mdio/mdio-mux-bcm-iproc.c | 10 +-
drivers/net/mdio/mdio-mux-gpio.c | 8 +-
drivers/net/mdio/mdio-mux-mmioreg.c | 6 +-
drivers/net/mdio/mdio-mux-multiplexer.c | 2 +-
drivers/net/mdio/mdio-mux.c | 6 +-
drivers/net/mdio/mdio-octeon.c | 8 +-
drivers/net/mdio/mdio-thunder.c | 10 +-
drivers/net/mdio/mdio-xgene.c | 6 +-
drivers/net/mdio/of_mdio.c | 10 +-
drivers/net/slip/slip.c | 2 +-
drivers/net/usb/aqc111.c | 9 +-
drivers/net/veth.c | 2 +-
drivers/net/wireless/ath/ath9k/main.c | 2 +-
drivers/net/wireless/ath/ath9k/xmit.c | 33 +-
drivers/perf/fsl_imx8_ddr_perf.c | 2 +-
drivers/regulator/wm8994-regulator.c | 42 +-
drivers/scsi/be2iscsi/be_iscsi.c | 19 +-
drivers/scsi/be2iscsi/be_main.c | 8 +-
drivers/scsi/bnx2i/bnx2i_iscsi.c | 31 +-
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 8 +-
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 8 +-
drivers/scsi/cxgbi/libcxgbi.c | 12 +-
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
drivers/scsi/libiscsi.c | 70 ++-
drivers/scsi/lpfc/lpfc_init.c | 2 +
drivers/scsi/megaraid/megaraid_sas.h | 3 +
drivers/scsi/megaraid/megaraid_sas_base.c | 7 +
drivers/scsi/mvsas/mv_init.c | 1 +
drivers/scsi/pm8001/pm80xx_hwi.c | 33 +-
drivers/scsi/qedi/qedi_iscsi.c | 32 +-
drivers/scsi/qla4xxx/ql4_os.c | 8 +-
drivers/scsi/scsi_transport_iscsi.c | 587 +++++++++++-------
drivers/target/target_core_user.c | 3 +-
fs/btrfs/block-group.c | 4 -
fs/btrfs/disk-io.c | 5 +-
fs/btrfs/file.c | 13 +-
fs/btrfs/inode.c | 1 -
fs/btrfs/volumes.c | 2 +
fs/cifs/link.c | 3 +
include/asm-generic/tlb.h | 10 +-
include/scsi/iscsi_if.h | 1 +
include/scsi/libiscsi.h | 1 +
include/scsi/scsi_transport_iscsi.h | 39 +-
include/trace/events/sunrpc.h | 7 +-
kernel/dma/direct.h | 3 +-
kernel/irq/affinity.c | 5 +-
kernel/smp.c | 2 +-
kernel/time/tick-sched.c | 2 +-
kernel/time/timer.c | 11 +-
mm/kmemleak.c | 8 +-
mm/page_alloc.c | 2 +-
mm/page_io.c | 54 --
net/ipv6/ip6_output.c | 2 +-
net/nfc/nci/core.c | 4 +
net/sched/cls_api.c | 2 +-
net/sched/sch_taprio.c | 3 +-
net/sctp/socket.c | 2 +-
net/smc/smc_pnet.c | 5 +-
net/wireless/nl80211.c | 3 +-
net/wireless/scan.c | 2 +
scripts/gcc-plugins/latent_entropy_plugin.c | 44 +-
sound/core/pcm_misc.c | 2 +-
sound/pci/hda/patch_realtek.c | 2 +
tools/perf/util/parse-events.c | 5 +-
.../testing/selftests/mqueue/mq_perf_tests.c | 25 +-
115 files changed, 1046 insertions(+), 565 deletions(-)
--
2.20.1
1
95

19 Jul '22
From: Wang Wensheng <wangwensheng4(a)huawei.com>
hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5DS9S
CVE: NA
--------------------------------------------------
This is not used for THP but the user page table is just like THP. The
user alloc hugepages via a special driver and its vma is not marked with
VM_HUGETLB. This commit allow to share those vma to kernel.
Signed-off-by: Wang Wensheng <wangwensheng4(a)huawei.com>
Reviewed-by: Weilong Chen <chenweilong(a)huawei.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
---
include/linux/share_pool.h | 1 +
mm/share_pool.c | 44 +++++++++++++++++++++++++++++++++-----
2 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/include/linux/share_pool.h b/include/linux/share_pool.h
index 6f294911c6af..d95084b8f624 100644
--- a/include/linux/share_pool.h
+++ b/include/linux/share_pool.h
@@ -178,6 +178,7 @@ struct sp_walk_data {
unsigned long uva_aligned;
unsigned long page_size;
bool is_hugepage;
+ bool is_page_type_set;
pmd_t *pmd;
};
diff --git a/mm/share_pool.c b/mm/share_pool.c
index 76088952d0a5..60ad48e238c4 100644
--- a/mm/share_pool.c
+++ b/mm/share_pool.c
@@ -2994,9 +2994,40 @@ EXPORT_SYMBOL_GPL(mg_sp_make_share_k2u);
static int sp_pmd_entry(pmd_t *pmd, unsigned long addr,
unsigned long next, struct mm_walk *walk)
{
+ struct page *page;
struct sp_walk_data *sp_walk_data = walk->private;
+ /*
+ * There exist a scene in DVPP where the pagetable is huge page but its
+ * vma doesn't record it, something like THP.
+ * So we cannot make out whether it is a hugepage map until we access the
+ * pmd here. If mixed size of pages appear, just return an error.
+ */
+ if (pmd_huge(*pmd)) {
+ if (!sp_walk_data->is_page_type_set) {
+ sp_walk_data->is_page_type_set = true;
+ sp_walk_data->is_hugepage = true;
+ } else if (!sp_walk_data->is_hugepage)
+ return -EFAULT;
+
+ /* To skip pte level walk */
+ walk->action = ACTION_CONTINUE;
+
+ page = pmd_page(*pmd);
+ get_page(page);
+ sp_walk_data->pages[sp_walk_data->page_count++] = page;
+
+ return 0;
+ }
+
+ if (!sp_walk_data->is_page_type_set) {
+ sp_walk_data->is_page_type_set = true;
+ sp_walk_data->is_hugepage = false;
+ } else if (sp_walk_data->is_hugepage)
+ return -EFAULT;
+
sp_walk_data->pmd = pmd;
+
return 0;
}
@@ -3140,6 +3171,8 @@ static int __sp_walk_page_range(unsigned long uva, unsigned long size,
sp_walk.pmd_entry = sp_pmd_entry;
}
+ sp_walk_data->is_page_type_set = false;
+ sp_walk_data->page_count = 0;
sp_walk_data->page_size = page_size;
uva_aligned = ALIGN_DOWN(uva, page_size);
sp_walk_data->uva_aligned = uva_aligned;
@@ -3164,8 +3197,12 @@ static int __sp_walk_page_range(unsigned long uva, unsigned long size,
ret = walk_page_range(mm, uva_aligned, uva_aligned + size_aligned,
&sp_walk, sp_walk_data);
- if (ret)
+ if (ret) {
+ while (sp_walk_data->page_count--)
+ put_page(pages[sp_walk_data->page_count]);
kvfree(pages);
+ sp_walk_data->pages = NULL;
+ }
return ret;
}
@@ -3201,9 +3238,7 @@ void *sp_make_share_u2k(unsigned long uva, unsigned long size, int pid)
int ret = 0;
struct mm_struct *mm = current->mm;
void *p = ERR_PTR(-ESRCH);
- struct sp_walk_data sp_walk_data = {
- .page_count = 0,
- };
+ struct sp_walk_data sp_walk_data;
struct vm_struct *area;
check_interrupt_context();
@@ -3544,7 +3579,6 @@ int sp_walk_page_range(unsigned long uva, unsigned long size,
return -ESRCH;
}
- sp_walk_data->page_count = 0;
down_write(&mm->mmap_lock);
if (likely(!mm->core_state))
ret = __sp_walk_page_range(uva, size, mm, sp_walk_data);
--
2.20.1
1
22
Backport 5.10.112 LTS patches from upstream.
git cherry-pick v5.10.111..v5.10.112~1 -s
Complicts:
Already merged(10):
80a4df14643f7 hamradio: defer 6pack kfree after unregister_netdev
cfa98ffc42f16 hamradio: remove needs_free_netdev to avoid UAF
5ea00fc60676 ax25: add refcount in ax25_dev to avoid UAF bugs
5ddae8d06441 ax25: fix reference count leaks of ax25_dev
57cc15f5fd55 ax25: fix UAF bugs of net_device caused by rebinding operation
b20a5ab0f5fb ax25: Fix refcount leaks caused by ax25_cb_del()
a4942c6fea87 ax25: fix UAF bug in ax25_send_control()
145ea8d213e8 ax25: fix NPD bug in ax25_disconnect
f934fa478dd1 ax25: Fix NULL pointer dereferences in ax25 timers
5c62d3bf1410 ax25: Fix UAF bugs in ax25 timers
Total patches: 104 - 10 = 94
Adrian Hunter (1):
perf tools: Fix misleading add event PMU debug message
Ajish Koshy (2):
scsi: pm80xx: Mask and unmask upper interrupt vectors 32-63
scsi: pm80xx: Enable upper inbound, outbound queues
Alexey Galakhov (1):
scsi: mvsas: Add PCI ID of RocketRaid 2640
Andy Chiu (1):
net: axienet: setup mdio unconditionally
Anna-Maria Behnsen (1):
timers: Fix warning condition in __run_timers()
Athira Rajeev (1):
testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu
set
Aurabindo Pillai (1):
drm/amd: Add USBC connector ID
Benedikt Spranger (1):
net/sched: taprio: Check if socket flags are valid
Borislav Petkov (1):
perf/imx_ddr: Fix undefined behavior due to shift overflowing the
constant
Calvin Johnson (1):
net: mdio: Alphabetically sort header inclusion
Chandrakanth patil (1):
scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan
Chao Gao (1):
dma-direct: avoid redundant memory sync for swiotlb
Charlene Liu (1):
drm/amd/display: fix audio format not updated after edid updated
Chiawen Huang (1):
drm/amd/display: FEC check in timing validation
Christian Lamparter (1):
ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs
Chuck Lever (1):
SUNRPC: Fix the svc_deferred_event trace class
Cristian Marussi (1):
firmware: arm_scmi: Fix sorting of retrieved clock rates
Darrick J. Wong (1):
btrfs: fix fallocate to use file_modified to update permissions
consistently
Dinh Nguyen (1):
net: ethernet: stmmac: fix altr_tse_pcs function when using a
fixed-link
Duoming Zhou (1):
drivers: net: slip: fix NPD bug in sl_tx_timeout()
Fabio M. De Francesco (1):
ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
Felix Kuehling (1):
drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu
Guillaume Nault (1):
veth: Ensure eth header is in skb's linear part
Harshit Mogalapalli (1):
cifs: potential buffer overflow in handling symlinks
James Smart (1):
scsi: lpfc: Fix queue failures when recovering from PCI parity error
Jason A. Donenfeld (1):
gcc-plugins: latent_entropy: use /dev/urandom
Jeremy Linton (1):
net: bcmgenet: Revert "Use stronger register read/writes to assure
ordering"
Jia-Ju Bai (1):
btrfs: fix root ref counts in error handling in btrfs_get_root_ref
Joey Gouly (1):
arm64: alternatives: mark patch_alternative() as `noinstr`
Johan Hovold (1):
memory: renesas-rpc-if: fix platform-device leak in error path
Johannes Berg (1):
nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size
Jonathan Bakker (1):
regulator: wm8994: Add an off-on delay for WM8994 variant
Josef Bacik (1):
btrfs: do not warn for free space inode in cow_file_range
Juergen Gross (1):
mm, page_alloc: fix build_zonerefs_node()
Karsten Graul (1):
net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()
Khazhismel Kumykov (1):
dm mpath: only use ktime_get_ns() in historical selector
Kyle Copperfield (1):
media: rockchip/rga: do proper error checking in probe
Leo (Hanghong) Ma (1):
drm/amd/display: Update VTEM Infopacket definition
Leo Ruan (1):
gpu: ipu-v3: Fix dev_dbg frequency output
Lin Ma (1):
nfc: nci: add flush_workqueue to prevent uaf
Linus Torvalds (1):
gpiolib: acpi: use correct format characters
Marcelo Ricardo Leitner (1):
net/sched: fix initialization order when updating chain 0 head
Marcin Kozlowski (1):
net: usb: aqc111: Fix out-of-bounds accesses in RX fixup
Mario Limonciello (2):
cpuidle: PSCI: Move the `has_lpi` check to the beginning of the
function
ACPI: processor idle: Check for architectural support for LPI
Martin Leung (1):
drm/amd/display: Revert FEC check in validation
Martin Povišer (1):
i2c: pasemi: Wait for write xfers to finish
Melissa Wen (1):
drm/amd/display: don't ignore alpha property on pre-multiplied mode
Miaoqian Lin (1):
memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe
Michael Kelley (1):
Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer
Michael Walle (1):
net: dsa: felix: suppress -EPROBE_DEFER errors
Mike Christie (10):
scsi: iscsi: Stop queueing during ep_disconnect
scsi: iscsi: Force immediate failure during shutdown
scsi: iscsi: Use system_unbound_wq for destroy_work
scsi: iscsi: Rel ref after iscsi_lookup_endpoint()
scsi: iscsi: Fix in-kernel conn failure handling
scsi: iscsi: Move iscsi_ep_disconnect()
scsi: iscsi: Fix offload conn cleanup when iscsid restarts
scsi: iscsi: Fix conn cleanup and stop race during iscsid restart
scsi: iscsi: Fix endpoint reuse regression
scsi: iscsi: Fix unbound endpoint error handling
Mikulas Patocka (1):
dm integrity: fix memory corruption when tag_size is less than digest
size
Minchan Kim (1):
mm: fix unexpected zeroed page mapping with zram swap
Nadav Amit (1):
smp: Fix offline cpu check in flush_smp_call_function_queue()
Naohiro Aota (1):
btrfs: mark resumed async balance as writing
Nathan Chancellor (2):
btrfs: remove unused variable in
btrfs_{start,write}_dirty_block_groups()
ARM: davinci: da850-evm: Avoid NULL pointer dereference
Nicolas Dichtel (1):
ipv6: fix panic when forwarding a pkt with no in6 dev
Patrick Wang (1):
mm: kmemleak: take a full lowmem check in kmemleak_*_phys()
Paul Gortmaker (1):
tick/nohz: Use WARN_ON_ONCE() to prevent console saturation
Petr Malat (1):
sctp: Initialize daddr on peeled off socket
QintaoShen (1):
drm/amdkfd: Check for potential null return of kmalloc_array()
Rameshkumar Sundaram (1):
cfg80211: hold bss_lock while updating nontrans_list
Randy Dunlap (1):
net: micrel: fix KS8851_MLL Kconfig
Rei Yamamoto (1):
genirq/affinity: Consider that CPUs on nodes can be unbalanced
Rob Clark (2):
drm/msm: Add missing put_task_struct() in debugfs path
drm/msm: Fix range size vs end confusion
Roman Li (1):
drm/amd/display: Fix allocate_mst_payload assert on resume
Sean Christopherson (1):
KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded
Stephen Boyd (1):
drm/msm/dsi: Use connector directly in
msm_dsi_manager_connector_init()
Steve Capper (1):
tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry
Tao Jin (1):
ALSA: hda/realtek: add quirk for Lenovo Thinkpad X12 speakers
Tianci Yin (1):
drm/amdgpu/vcn: improve vcn dpg stop procedure
Tim Crawford (1):
ALSA: hda/realtek: Add quirk for Clevo PD50PNT
Toke Høiland-Jørgensen (2):
ath9k: Properly clear TX status area before reporting to mac80211
ath9k: Fix usage of driver-private space in tx_info
Tomasz Moń (1):
drm/amdgpu: Enable gfxoff quirk on MacBook Pro
Tushar Patel (1):
drm/amdkfd: Fix Incorrect VMIDs passed to HWS
Tyrel Datwyler (1):
scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024
Vadim Pasternak (1):
mlxsw: i2c: Fix initialization error flow
Vlad Buslov (1):
net/sched: flower: fix parsing of ethertype following VLAN header
Xiaoguang Wang (1):
scsi: target: tcmu: Fix possible page UAF
Xiaomeng Tong (1):
myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
arch/arm/mach-davinci/board-da850-evm.c | 4 +-
arch/arm64/kernel/alternative.c | 6 +-
arch/arm64/kernel/cpuidle.c | 6 +-
arch/x86/include/asm/kvm_host.h | 5 +-
arch/x86/kvm/mmu/mmu.c | 20 +-
arch/x86/kvm/x86.c | 20 +-
drivers/acpi/processor_idle.c | 15 +-
drivers/ata/libata-core.c | 3 +
drivers/firmware/arm_scmi/clock.c | 3 +-
drivers/gpio/gpiolib-acpi.c | 4 +-
drivers/gpu/drm/amd/amdgpu/ObjectID.h | 1 +
.../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 11 +-
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 4 +-
.../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +-
.../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 14 +-
.../display/modules/info_packet/info_packet.c | 5 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +-
drivers/gpu/drm/msm/msm_gem.c | 1 +
drivers/gpu/ipu-v3/ipu-di.c | 5 +-
drivers/hv/ring_buffer.c | 11 +-
drivers/i2c/busses/i2c-pasemi.c | 6 +
drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +
drivers/md/dm-historical-service-time.c | 10 +-
drivers/md/dm-integrity.c | 7 +-
drivers/media/platform/rockchip/rga/rga.c | 2 +-
drivers/memory/atmel-ebi.c | 23 +-
drivers/memory/renesas-rpc-if.c | 10 +-
drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +-
.../net/ethernet/broadcom/genet/bcmgenet.c | 4 +-
drivers/net/ethernet/mellanox/mlxsw/i2c.c | 1 +
drivers/net/ethernet/micrel/Kconfig | 1 +
.../net/ethernet/myricom/myri10ge/myri10ge.c | 6 +-
.../ethernet/stmicro/stmmac/altr_tse_pcs.c | 8 -
.../ethernet/stmicro/stmmac/altr_tse_pcs.h | 4 +
.../ethernet/stmicro/stmmac/dwmac-socfpga.c | 13 +-
.../net/ethernet/xilinx/xilinx_axienet_main.c | 13 +-
drivers/net/mdio/mdio-bcm-unimac.c | 16 +-
drivers/net/mdio/mdio-bitbang.c | 4 +-
drivers/net/mdio/mdio-cavium.c | 2 +-
drivers/net/mdio/mdio-gpio.c | 10 +-
drivers/net/mdio/mdio-ipq4019.c | 4 +-
drivers/net/mdio/mdio-ipq8064.c | 4 +-
drivers/net/mdio/mdio-mscc-miim.c | 8 +-
drivers/net/mdio/mdio-mux-bcm-iproc.c | 10 +-
drivers/net/mdio/mdio-mux-gpio.c | 8 +-
drivers/net/mdio/mdio-mux-mmioreg.c | 6 +-
drivers/net/mdio/mdio-mux-multiplexer.c | 2 +-
drivers/net/mdio/mdio-mux.c | 6 +-
drivers/net/mdio/mdio-octeon.c | 8 +-
drivers/net/mdio/mdio-thunder.c | 10 +-
drivers/net/mdio/mdio-xgene.c | 6 +-
drivers/net/mdio/of_mdio.c | 10 +-
drivers/net/slip/slip.c | 2 +-
drivers/net/usb/aqc111.c | 9 +-
drivers/net/veth.c | 2 +-
drivers/net/wireless/ath/ath9k/main.c | 2 +-
drivers/net/wireless/ath/ath9k/xmit.c | 33 +-
drivers/perf/fsl_imx8_ddr_perf.c | 2 +-
drivers/regulator/wm8994-regulator.c | 42 +-
drivers/scsi/be2iscsi/be_iscsi.c | 19 +-
drivers/scsi/be2iscsi/be_main.c | 1 +
drivers/scsi/bnx2i/bnx2i_iscsi.c | 24 +-
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 1 +
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 1 +
drivers/scsi/cxgbi/libcxgbi.c | 12 +-
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
drivers/scsi/libiscsi.c | 70 ++-
drivers/scsi/lpfc/lpfc_init.c | 2 +
drivers/scsi/megaraid/megaraid_sas.h | 3 +
drivers/scsi/megaraid/megaraid_sas_base.c | 7 +
drivers/scsi/mvsas/mv_init.c | 1 +
drivers/scsi/pm8001/pm80xx_hwi.c | 33 +-
drivers/scsi/qedi/qedi_iscsi.c | 26 +-
drivers/scsi/qla4xxx/ql4_os.c | 2 +
drivers/scsi/scsi_transport_iscsi.c | 541 +++++++++++-------
drivers/target/target_core_user.c | 3 +-
fs/btrfs/block-group.c | 4 -
fs/btrfs/disk-io.c | 5 +-
fs/btrfs/file.c | 13 +-
fs/btrfs/inode.c | 1 -
fs/btrfs/volumes.c | 2 +
fs/cifs/link.c | 3 +
include/asm-generic/tlb.h | 10 +-
include/net/flow_dissector.h | 2 +
include/scsi/libiscsi.h | 1 +
include/scsi/scsi_transport_iscsi.h | 14 +-
include/trace/events/sunrpc.h | 7 +-
kernel/dma/direct.h | 3 +-
kernel/irq/affinity.c | 5 +-
kernel/smp.c | 2 +-
kernel/time/tick-sched.c | 2 +-
kernel/time/timer.c | 11 +-
mm/kmemleak.c | 8 +-
mm/page_alloc.c | 2 +-
mm/page_io.c | 54 --
net/core/flow_dissector.c | 1 +
net/ipv6/ip6_output.c | 2 +-
net/nfc/nci/core.c | 4 +
net/sched/cls_api.c | 2 +-
net/sched/cls_flower.c | 18 +-
net/sched/sch_taprio.c | 3 +-
net/sctp/socket.c | 2 +-
net/smc/smc_pnet.c | 5 +-
net/wireless/nl80211.c | 3 +-
net/wireless/scan.c | 2 +
scripts/gcc-plugins/latent_entropy_plugin.c | 44 +-
sound/core/pcm_misc.c | 2 +-
sound/pci/hda/patch_realtek.c | 2 +
tools/perf/util/parse-events.c | 5 +-
.../testing/selftests/mqueue/mq_perf_tests.c | 25 +-
117 files changed, 959 insertions(+), 554 deletions(-)
--
2.20.1
1
94
Backport 5.10.111 LTS patches from upstream.
Complicts:
Already merged(4):
2dc49f58a29c ubifs: Rectify space amount budget for mkdir/tmpfile operations
c688705a3978 Revert "NFSv4: Handle the special Linux file open access mode"
2827328e646d io_uring: fix race between timeout flush and removal
4665722d36ad cgroup: Use open-time credentials for process migraton perm checks
Context conflict(3):
4820847e8bc2 usb: ehci: add pci device support for Aspeed platforms
8a7ada4b8f5d scsi: hisi_sas: Free irq vectors in order for v3 HW
9de98470db6e arm64: Add part number for Arm Cortex-A78AE
Rejected(1):
2f2f017ea873 dm: requeue IO if mapping table not yet available
Implement changed(-1+1):
d36febbcd537 powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit
Added(1):
ipv6: fix kabi for mc_forwarding in struct ipv6_devconf
Total patches: 170 - 4 - 1 + 1 - 1 + 1 = 166
Adam Wujek (1):
clk: si5341: fix reported clk_rate when output divider is 2
Adrian Hunter (1):
perf tools: Fix perf's libperf_print callback
Aharon Landau (1):
RDMA/mlx5: Don't remove cache MRs when a delay is needed
Alex Deucher (2):
drm/amdkfd: make CRAT table missing message informational only
drm/amdgpu/smu10: fix SoC/fclk units in auto mode
Alexander Lobakin (1):
MIPS: fix fortify panic when copying asm exception handlers
Amjad Ouled-Ameur (1):
phy: amlogic: meson8b-usb2: Use dev_err_probe()
Anatolii Gerasymenko (2):
ice: Set txq_teid to ICE_INVAL_TEID on ring creation
ice: Do not skip not enabled queues in ice_vc_dis_qs_msg
Andre Przywara (1):
irqchip/gic, gic-v3: Prevent GSI to SGI translations
Andrea Parri (Microsoft) (1):
Drivers: hv: vmbus: Replace smp_store_mb() with virt_store_mb()
Andreas Gruenbacher (2):
gfs2: Check for active reservation in gfs2_release
gfs2: gfs2_setattr_size error path fix
Andy Gospodarek (1):
bnxt_en: reserve space inside receive page for skb_shared_info
Anisse Astier (1):
drm: Add orientation quirk for GPD Win Max
Arnaldo Carvalho de Melo (4):
perf build: Don't use -ffat-lto-objects in the python feature test
when building with clang-13
perf python: Fix probing for some clang command line options
tools build: Filter out options and warnings not supported by clang
tools build: Use $(shell ) instead of `` to get embedded libperl's
ccopts
Avraham Stern (1):
cfg80211: don't add non transmitted BSS to 6GHz scanned channels
Bob Peterson (1):
gfs2: Fix gfs2_release for non-writers regression
Chanho Park (1):
arm64: Add part number for Arm Cortex-A78AE
Chen-Yu Tsai (1):
net: stmmac: Fix unset max_speed difference between DT and non-DT
platforms
Christian Lamparter (1):
ata: sata_dwc_460ex: Fix crash due to OOB write
Christophe JAILLET (1):
scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()
Dale Zhao (1):
drm/amd/display: Add signal type check when verify stream backends
same
Damien Le Moal (5):
scsi: pm8001: Fix pm80xx_pci_mem_copy() interface
scsi: pm8001: Fix pm8001_mpi_task_abort_resp()
scsi: pm8001: Fix task leak in pm8001_send_abort_all()
scsi: pm8001: Fix tag leaks on error
scsi: pm8001: Fix memory leak in pm8001_chip_fw_flash_update_req()
Dan Carpenter (1):
drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()
David Ahern (1):
ipv6: Fix stats accounting in ip6_pkt_drop
Denis Nikitin (1):
perf session: Remap buf if there is no space for event
Dongli Zhang (1):
xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32
Douglas Miller (1):
RDMA/hfi1: Fix use-after-free bug for mm struct
Dust Li (1):
net/smc: correct settings of RMB window update limit
Eric Dumazet (2):
ipv6: make mc_forwarding atomic
rxrpc: fix a race in rxrpc_exit_net()
Ethan Lien (1):
btrfs: fix qgroup reserve overflow the qgroup limit
Evgeny Boger (1):
power: supply: axp20x_battery: properly report current when
discharging
Fangrui Song (1):
arm64: module: remove (NOLOAD) from linker script
Guilherme G. Piccoli (1):
Drivers: hv: vmbus: Fix potential crash on module unload
Guo Ren (1):
arm64: patch_text: Fixup last cpu should be master
Guo Xuenan (1):
lz4: fix LZ4_decompress_safe_partial read out of bound
H. Nikolaus Schaller (1):
usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm
Haimin Zhang (1):
jfs: prevent NULL deref in diFree
Hangyu Hua (2):
mips: ralink: fix a refcount leak in ill_acc_of_setup()
powerpc/secvar: fix refcount leak in format_show()
Hans de Goede (1):
power: supply: axp288-charger: Set Vhold to 4.4V
Harold Huang (1):
tuntap: add sanity checks about msg_controllen in sendmsg
Helge Deller (1):
parisc: Fix CPU affinity for Lasi, WAX and Dino chips
Hou Wenlong (1):
KVM: x86/emulator: Emulate RDPID only if it is enabled in guest
Hou Zhiqiang (1):
PCI: endpoint: Fix alignment fault error in copy tests
Ido Schimmel (1):
ipv4: Invalidate neighbour for broadcast address upon address addition
Ilan Peer (1):
iwlwifi: mvm: Correctly set fragmented EBS
Ilya Maximets (2):
net: openvswitch: don't send internal clone attribute to the
userspace.
net: openvswitch: fix leak of nested actions
Ivan Vecera (1):
ice: Clear default forwarding VSI during VSI release
Jakub Kicinski (2):
net: account alternate interface name memory
net: limit altnames to 64k total
Jakub Sitnicki (1):
bpf: Make dst_port field in struct bpf_sock 16-bit wide
James Clark (1):
perf: arm-spe: Fix perf report --mem-mode
Jamie Bainbridge (1):
qede: confirm skb is allocated before using
Jianglei Nie (1):
scsi: libfc: Fix use after free in fc_exch_abts_resp()
Jiasheng Jiang (2):
rtc: wm8350: Handle error for wm8350_register_irq
drm/imx: imx-ldb: Check for null pointer after calling kmemdup
Jim Mattson (1):
KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs
Jiri Slaby (1):
serial: samsung_tty: do not unlock port->lock for uart_write_wakeup()
John David Anglin (1):
parisc: Fix patch code locking and flushing
Jordy Zomer (1):
dm ioctl: prevent potential spectre v1 gadget
José Expósito (1):
drm/imx: Fix memory leak in imx_pd_connector_get_modes
Kaiwen Hu (1):
btrfs: prevent subvol with swapfile from being deleted
Kalle Valo (1):
ath11k: mhi: use mhi_sync_power_up()
Kamal Dasu (1):
spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
Karol Herbst (1):
drm/nouveau/pmu: Add missing callbacks for Tegra devices
Kees Cook (1):
ubsan: remove CONFIG_UBSAN_OBJECT_SIZE
Kefeng Wang (1):
powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit
Krzysztof Kozlowski (1):
MIPS: ingenic: correct unit node address
Lee Jones (1):
drm/amdkfd: Create file descriptor after client is added to
smi_clients list
Li Chen (1):
PCI: endpoint: Fix misused goto label
Lorenzo Bianconi (1):
mt76: dma: initialize skip_unmap in mt76_dma_rx_fill
Lucas Denefle (1):
w1: w1_therm: fixes w1_seq for ds28ea00 sensors
Luiz Augusto von Dentz (2):
Bluetooth: Fix not checking for valid hdev on
bt_dev_{info,warn,err,dbg}
Bluetooth: Fix use after free in hci_send_acl
Lv Yunlong (1):
drbd: Fix five use after free bugs in get_initial_state
Maciej Fijalkowski (1):
ice: synchronize_rcu() when terminating rings
Manivannan Sadhasivam (1):
PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
Marc Zyngier (1):
irqchip/gic-v3: Fix GICR_CTLR.RWP polling
Martin Habets (1):
sfc: Do not free an empty page_ring
Mauricio Faria de Oliveira (1):
mm: fix race between MADV_FREE reclaim and blkdev direct IO read
Max Filippov (1):
xtensa: fix DTC warning unit_address_format
Maxim Kiselev (1):
powerpc: dts: t104xrdb: fix phy type for FMAN 4/5
Maxim Mikityanskiy (1):
bpf: Support dual-stack sockets in bpf_tcp_check_syncookie
Maxime Ripard (1):
clk: Enforce that disjoints limits are invalid
Miaohe Lin (1):
mm/mempolicy: fix mpol_new leak in shared_policy_replace
Miaoqian Lin (1):
dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe
Michael Chan (1):
bnxt_en: Eliminate unintended link toggle during FW reset
Michael Walle (2):
net: sfp: add 2500base-X quirk for Lantech SFP module
net: phy: mscc-miim: reject clause 45 register accesses
Minghao Chi (CGEL ZTE) (1):
Bluetooth: use memset avoid memory leaks
Nathan Chancellor (1):
x86/Kconfig: Do not allow CONFIG_X86_X32_ABI=y with llvm-objcopy
Neal Liu (1):
usb: ehci: add pci device support for Aspeed platforms
NeilBrown (5):
SUNRPC/call_alloc: async tasks mustn't block waiting for memory
SUNRPC/xprt: async tasks mustn't block waiting for memory
SUNRPC: remove scheduling boost for "SWAPPER" tasks.
NFS: swap IO handling is slightly different for O_DIRECT IO
NFS: swap-out must always use STABLE writes.
Niels Dossche (1):
IB/rdmavt: add lock to call to rvt_error_qp to prevent a race
condition
Nikolay Aleksandrov (1):
net: ipv4: fix route with nexthop object delete warning
Oliver Hartkopp (1):
can: isotp: set default value for N_As to 50 micro seconds
Pali Rohár (2):
PCI: aardvark: Fix support for MSI interrupts
Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning"
Paolo Bonzini (1):
mmmremap.c: avoid pointless invalidate_range_start/end on
mremap(old_size=0)
Pavel Begunkov (1):
io_uring: don't touch scm_fp_list after queueing skb
Pawan Gupta (2):
x86/pm: Save the MSR validity status at context setup
x86/speculation: Restore speculation related MSRs during S3 resume
Peter Xu (1):
mm: don't skip swap entry even if zap_details specified
Qi Liu (1):
scsi: hisi_sas: Free irq vectors in order for v3 HW
Qinghua Jin (1):
minix: fix bug when opening a file with O_DIRECT
Rajneesh Bhardwaj (1):
drm/amdgpu: Fix recursive locking warning
Randy Dunlap (3):
scsi: aha152x: Fix aha152x_setup() __setup handler return value
init/main.c: return 1 from handled __setup() functions
virtio_console: eliminate anonymous module_init & module_exit
Sachin Sant (1):
selftests/cgroup: Fix build on older distros
Sasha Levin (1):
Revert "hv: utils: add PTP_1588_CLOCK to Kconfig to fix build"
Sebastian Andrzej Siewior (1):
tcp: Don't acquire inet_listen_hashbucket::lock with disabled BH.
Shreeya Patel (1):
gpio: Restrict usage of GPIO chip irq members before initialization
Sourabh Jain (1):
powerpc: Set crashkernel offset to mid of RMA region
Stefan Wahren (1):
staging: vchiq_core: handle NULL result of find_service_by_handle
Sven Eckelmann (1):
macvtap: advertise link netns via netlink
Tejun Heo (3):
selftests: cgroup: Make cg_create() use 0755 for permission instead of
0644
selftests: cgroup: Test open-time credential usage for migration
checks
selftests: cgroup: Test open-time cgroup namespace usage for migration
checks
Tony Lindgren (2):
clk: ti: Preserve node in ti_dt_clocks_register()
iommu/omap: Fix regression in probe for NULL pointer dereference
Trond Myklebust (7):
NFSv4: Protect the state recovery thread against direct reclaim
SUNRPC: Fix socket waits for write buffer space
NFS: nfsiod should not block forever in mempool_alloc()
NFS: Avoid writeback threads getting stuck in mempool_alloc()
SUNRPC: Handle ENOMEM in call_transmit_status()
SUNRPC: Handle low memory situations in call_status()
SUNRPC: svc_tcp_sendmsg() should handle errors from xdr_alloc_bvec()
Venkateswara Naralasetty (1):
ath11k: fix kernel panic during unload/load ath11k modules
Vinod Koul (1):
dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on
error"
Waiman Long (1):
mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning
Wang Yufen (1):
netlabel: fix out-of-bounds memory accesses
Wayne Chang (2):
usb: gadget: tegra-xudc: Do not program SPARAM
usb: gadget: tegra-xudc: Fix control endpoint's definitions
Wolfram Sang (1):
mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is
complete
Xiaoke Wang (1):
staging: wfx: fix an error handling in wfx_init_common()
Xiaomeng Tong (1):
perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
Xin Xiong (2):
drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj
NFSv4.2: fix reference count leaks in _nfs42_proc_copy_notify()
Xiubo Li (1):
ceph: fix memory leak in ceph_readdir when note_last_dentry returns
error
Yang Guang (3):
ptp: replace snprintf with sysfs_emit
scsi: mvsas: Replace snprintf() with sysfs_emit()
scsi: bfa: Replace snprintf() with sysfs_emit()
Yang Li (1):
mt76: mt7615: Fix assigning negative values to unsigned variable
Yann Gautier (1):
mmc: mmci: stm32: correctly check all elements of sg list
Yonghong Song (1):
libbpf: Fix build issue with llvm-readelf
Zekun Shen (1):
ath5k: fix OOB in ath5k_eeprom_read_pcal_info_5111
Zheng Zengkai (2):
ipv6: fix kabi for mc_forwarding in struct ipv6_devconf
Revert "powerpc: Fix virt_addr_valid() check"
Zhou Guanghui (1):
iommu/arm-smmu-v3: fix event handling soft lockup
Ziyang Xuan (1):
net/tls: fix slab-out-of-bounds bug in decrypt_internal
arch/arm64/include/asm/cputype.h | 2 +
arch/arm64/include/asm/module.lds.h | 6 +-
arch/arm64/kernel/insn.c | 4 +-
arch/arm64/kernel/proton-pack.c | 1 +
arch/mips/boot/dts/ingenic/jz4780.dtsi | 2 +-
arch/mips/include/asm/setup.h | 2 +-
arch/mips/kernel/traps.c | 22 +--
arch/mips/ralink/ill_acc.c | 1 +
arch/parisc/kernel/patch.c | 25 ++-
arch/powerpc/boot/dts/fsl/t104xrdb.dtsi | 4 +-
arch/powerpc/include/asm/page.h | 7 +-
arch/powerpc/kernel/rtas.c | 6 +
arch/powerpc/kernel/secvar-sysfs.c | 9 +-
arch/powerpc/kexec/core.c | 15 +-
arch/x86/Kconfig | 5 +
arch/x86/kvm/emulate.c | 4 +-
arch/x86/kvm/kvm_emulate.h | 1 +
arch/x86/kvm/svm/pmu.c | 8 +-
arch/x86/kvm/x86.c | 6 +
arch/x86/power/cpu.c | 21 ++-
arch/x86/xen/smp_hvm.c | 6 +
arch/x86/xen/time.c | 24 ++-
arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi | 8 +-
arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi | 8 +-
arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi | 4 +-
drivers/ata/sata_dwc_460ex.c | 6 +-
drivers/block/drbd/drbd_int.h | 8 +-
drivers/block/drbd/drbd_nl.c | 41 +++--
drivers/block/drbd/drbd_state.c | 18 +-
drivers/block/drbd/drbd_state_change.h | 8 +-
drivers/char/virtio_console.c | 8 +-
drivers/clk/clk-si5341.c | 16 +-
drivers/clk/clk.c | 24 +++
drivers/clk/ti/clk.c | 13 +-
drivers/dma/sh/shdma-base.c | 4 +-
drivers/gpio/gpiolib.c | 19 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +-
drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +-
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 24 ++-
.../gpu/drm/amd/display/dc/core/dc_resource.c | 3 +
.../drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 +-
.../gpu/drm/drm_panel_orientation_quirks.c | 6 +
drivers/gpu/drm/imx/imx-ldb.c | 2 +
drivers/gpu/drm/imx/parallel-display.c | 4 +-
.../gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c | 1 +
.../gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c | 2 +-
.../gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c | 1 +
.../gpu/drm/nouveau/nvkm/subdev/pmu/priv.h | 1 +
drivers/hv/Kconfig | 1 -
drivers/hv/channel_mgmt.c | 6 +-
drivers/hv/vmbus_drv.c | 9 +-
drivers/infiniband/hw/hfi1/mmu_rb.c | 6 +
drivers/infiniband/hw/mlx5/mr.c | 4 +-
drivers/infiniband/sw/rdmavt/qp.c | 6 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
drivers/iommu/omap-iommu.c | 2 +-
drivers/irqchip/irq-gic-v3.c | 14 +-
drivers/irqchip/irq-gic.c | 6 +
drivers/md/dm-ioctl.c | 2 +
drivers/mmc/host/mmci_stm32_sdmmc.c | 6 +-
drivers/mmc/host/renesas_sdhi_core.c | 4 +-
drivers/mmc/host/sdhci-xenon.c | 10 --
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +-
.../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +-
.../net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 +-
drivers/net/ethernet/intel/ice/ice.h | 2 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 3 +
drivers/net/ethernet/intel/ice/ice_main.c | 4 +-
.../net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 +-
drivers/net/ethernet/intel/ice/ice_xsk.c | 4 +-
drivers/net/ethernet/qlogic/qede/qede_fp.c | 3 +
drivers/net/ethernet/sfc/rx_common.c | 3 +
.../ethernet/stmicro/stmmac/stmmac_platform.c | 3 +-
drivers/net/macvtap.c | 6 +
drivers/net/mdio/mdio-mscc-miim.c | 6 +
drivers/net/phy/sfp-bus.c | 6 +
drivers/net/tap.c | 3 +-
drivers/net/tun.c | 3 +-
drivers/net/wireless/ath/ath11k/ahb.c | 2 +
drivers/net/wireless/ath/ath11k/mhi.c | 2 +-
drivers/net/wireless/ath/ath5k/eeprom.c | 3 +
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 5 +-
drivers/net/wireless/mediatek/mt76/dma.c | 1 +
.../net/wireless/mediatek/mt76/mt7615/mac.c | 2 +-
drivers/parisc/dino.c | 41 ++++-
drivers/parisc/gsc.c | 31 ++++
drivers/parisc/gsc.h | 1 +
drivers/parisc/lasi.c | 7 +-
drivers/parisc/wax.c | 7 +-
drivers/pci/controller/pci-aardvark.c | 16 +-
drivers/pci/endpoint/functions/pci-epf-test.c | 14 +-
drivers/pci/hotplug/pciehp_hpc.c | 2 +
drivers/perf/qcom_l2_pmu.c | 6 +-
drivers/phy/amlogic/phy-meson8b-usb2.c | 5 +-
drivers/power/supply/axp20x_battery.c | 13 +-
drivers/power/supply/axp288_charger.c | 14 +-
drivers/ptp/ptp_sysfs.c | 4 +-
drivers/rtc/rtc-wm8350.c | 11 +-
drivers/scsi/aha152x.c | 6 +-
drivers/scsi/bfa/bfad_attr.c | 26 +--
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 16 +-
drivers/scsi/libfc/fc_exch.c | 1 +
drivers/scsi/mvsas/mv_init.c | 4 +-
drivers/scsi/pm8001/pm8001_hwi.c | 27 ++-
drivers/scsi/pm8001/pm8001_sas.c | 2 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 17 +-
drivers/scsi/zorro7xx.c | 2 +
drivers/spi/spi-bcm-qspi.c | 4 +-
.../interface/vchiq_arm/vchiq_core.c | 6 +
drivers/staging/wfx/main.c | 7 +-
drivers/tty/serial/samsung_tty.c | 5 +-
drivers/usb/dwc3/dwc3-omap.c | 2 +-
drivers/usb/gadget/udc/tegra-xudc.c | 20 +--
drivers/usb/host/ehci-pci.c | 9 +
drivers/vhost/net.c | 1 +
drivers/w1/slaves/w1_therm.c | 8 +-
fs/btrfs/extent_io.h | 2 +-
fs/btrfs/inode.c | 22 +++
fs/ceph/dir.c | 11 +-
fs/gfs2/bmap.c | 2 +-
fs/gfs2/file.c | 3 +-
fs/gfs2/inode.c | 2 +-
fs/gfs2/rgrp.c | 7 +-
fs/gfs2/rgrp.h | 2 +-
fs/gfs2/super.c | 2 +-
fs/io_uring.c | 8 +-
fs/jfs/inode.c | 3 +-
fs/minix/inode.c | 3 +-
fs/nfs/direct.c | 48 +++--
fs/nfs/file.c | 4 +-
fs/nfs/internal.h | 7 +
fs/nfs/nfs42proc.c | 9 +-
fs/nfs/nfs4state.c | 12 ++
fs/nfs/pagelist.c | 10 +-
fs/nfs/pnfs_nfs.c | 8 +-
fs/nfs/write.c | 34 ++--
include/linux/gpio/driver.h | 9 +
include/linux/ipv6.h | 2 +-
include/linux/mmzone.h | 11 +-
include/linux/nfs_fs.h | 10 +-
include/net/arp.h | 1 +
include/net/bluetooth/bluetooth.h | 14 +-
include/uapi/linux/bpf.h | 3 +-
include/uapi/linux/can/isotp.h | 28 ++-
init/main.c | 6 +-
lib/lz4/lz4_decompress.c | 8 +-
lib/test_ubsan.c | 11 --
mm/memory.c | 25 ++-
mm/mempolicy.c | 1 +
mm/mremap.c | 3 +
mm/rmap.c | 25 ++-
net/batman-adv/multicast.c | 2 +-
net/bluetooth/hci_event.c | 3 +-
net/bluetooth/l2cap_core.c | 1 +
net/can/isotp.c | 12 +-
net/core/filter.c | 27 ++-
net/core/rtnetlink.c | 13 +-
net/ipv4/arp.c | 9 +-
net/ipv4/fib_frontend.c | 5 +-
net/ipv4/fib_semantics.c | 7 +-
net/ipv4/inet_hashtables.c | 53 +++---
net/ipv6/addrconf.c | 4 +-
net/ipv6/inet6_hashtables.c | 5 +-
net/ipv6/ip6_input.c | 2 +-
net/ipv6/ip6mr.c | 8 +-
net/ipv6/route.c | 2 +-
net/netlabel/netlabel_kapi.c | 2 +
net/openvswitch/actions.c | 2 +-
net/openvswitch/flow_netlink.c | 99 ++++++++++-
net/rxrpc/net_ns.c | 2 +-
net/smc/smc_core.c | 2 +-
net/sunrpc/clnt.c | 7 +
net/sunrpc/sched.c | 11 +-
net/sunrpc/svcsock.c | 4 +-
net/sunrpc/xprt.c | 16 +-
net/sunrpc/xprtrdma/transport.c | 6 +-
net/sunrpc/xprtsock.c | 54 ++++--
net/tls/tls_sw.c | 2 +-
net/wireless/scan.c | 9 +-
scripts/Makefile.ubsan | 1 -
tools/build/feature/Makefile | 9 +-
tools/lib/bpf/Makefile | 4 +-
tools/perf/Makefile.config | 6 +
tools/perf/arch/arm64/util/arm-spe.c | 6 +
tools/perf/perf.c | 2 +-
tools/perf/util/session.c | 15 +-
tools/perf/util/setup.py | 8 +-
tools/testing/selftests/cgroup/cgroup_util.c | 6 +-
tools/testing/selftests/cgroup/test_core.c | 165 ++++++++++++++++++
191 files changed, 1365 insertions(+), 496 deletions(-)
--
2.20.1
1
165