Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
description of repo status
Open Source
>
Other
>
Operation System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
128
Star
73
Fork
329
src-openEuler
/
kernel
Closed
Code
Issues
1197
Pull Requests
35
Wiki
Insights
Pipelines
Service
JavaDoc
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
重启rpcbind服务导致/proc/net/unix socket句柄泄露
Done
#I59RN0
Bug
peulerosci
Opened this issue
2022-05-29 12:28
<h3>优先级:</h3>次要 <h3>详细描述:</h3> 【OS版本】 compiletime=2021-11-28-02-05-44 kernelversion=3.10.0-862.14.1.5.h648 release 2.0 (SP5) 【测试类型】 4) 【缺陷年龄】 历史存在 【测试步骤】 执行压力测试脚本: [root@localhost ~]# cat rpc.sh #!/bin/bash while true do systemctl stop rpcbind.service systemctl stop rpc-statd.service systemctl stop nfs-server.service systemctl restart rpcbind.service systemctl restart rpc-statd.service systemctl restart nfs-server.service done 【结果输出】 [root@localhost ~]# cat /proc/net/unix | wc -l 查询到的句柄一直在增长,但是lsof查询不到 ll /proc/*/fd也查询不到对应的inode 【预期输出】 cat /proc/net/unix | wc -l 查询到的句柄不会增长 【ISO/TAR(安全必填,其他选填)】 【定位人】 强小军/王海(hulk)<h3>原因分析:</h3> 【是否新引入rpm包,是否进行了安全编译选项扫描】 否 【定位分析】(有效问题请“先对原有功能进行描述,重点描述与当前故障现象相关的技术点、以及缺陷出现的触发条件、错误出现的函数等”;非问题“需要澄清技术细节,描述技术实现原理以及当前现象合理性的解释”;重复问题请“说明重复问题单号”) 触发场景:不断重启rpcbind、rpc-statd、nfs-server服务; 在启动nfs-server服务的过程中, rpc.nfsd 程序会向/proc/fs/nfsd/portlist 文件写入nfs服务监听端口号(默认tcp 2049), 该操作会调用sunrpc接口向rpcbind进行注册, 注册是通过unix socket (/var/run/rpcbind/rpcbind.sock) 完成的, 由于反复不断的重启服务,在unix socket连接过程中存在一定概率的连接失败, 而连接失败时sunrpc并未释放socket资源,导致句柄泄露. 问题现象:/proc/net/unix中查到大量的无效socket,lsof 命令查询不到对应的inode nfs启动时如下路径如果异常失败,socket资源没有释放:write_ports nfsd_create_serv svc_bindsvc_rpcb_setuprpcb_create_localrpcb_create_local_unixrpc_createxprt_create_transportxs_setup_localxs_local_setup_socket__sock_createxs_local_finish_connecting // 失败返回,但是没有释放socket 同步hulk 补丁: 分析: 【对外部(配置、头文件、外部函数)是否有影响】 否
<h3>优先级:</h3>次要 <h3>详细描述:</h3> 【OS版本】 compiletime=2021-11-28-02-05-44 kernelversion=3.10.0-862.14.1.5.h648 release 2.0 (SP5) 【测试类型】 4) 【缺陷年龄】 历史存在 【测试步骤】 执行压力测试脚本: [root@localhost ~]# cat rpc.sh #!/bin/bash while true do systemctl stop rpcbind.service systemctl stop rpc-statd.service systemctl stop nfs-server.service systemctl restart rpcbind.service systemctl restart rpc-statd.service systemctl restart nfs-server.service done 【结果输出】 [root@localhost ~]# cat /proc/net/unix | wc -l 查询到的句柄一直在增长,但是lsof查询不到 ll /proc/*/fd也查询不到对应的inode 【预期输出】 cat /proc/net/unix | wc -l 查询到的句柄不会增长 【ISO/TAR(安全必填,其他选填)】 【定位人】 强小军/王海(hulk)<h3>原因分析:</h3> 【是否新引入rpm包,是否进行了安全编译选项扫描】 否 【定位分析】(有效问题请“先对原有功能进行描述,重点描述与当前故障现象相关的技术点、以及缺陷出现的触发条件、错误出现的函数等”;非问题“需要澄清技术细节,描述技术实现原理以及当前现象合理性的解释”;重复问题请“说明重复问题单号”) 触发场景:不断重启rpcbind、rpc-statd、nfs-server服务; 在启动nfs-server服务的过程中, rpc.nfsd 程序会向/proc/fs/nfsd/portlist 文件写入nfs服务监听端口号(默认tcp 2049), 该操作会调用sunrpc接口向rpcbind进行注册, 注册是通过unix socket (/var/run/rpcbind/rpcbind.sock) 完成的, 由于反复不断的重启服务,在unix socket连接过程中存在一定概率的连接失败, 而连接失败时sunrpc并未释放socket资源,导致句柄泄露. 问题现象:/proc/net/unix中查到大量的无效socket,lsof 命令查询不到对应的inode nfs启动时如下路径如果异常失败,socket资源没有释放:write_ports nfsd_create_serv svc_bindsvc_rpcb_setuprpcb_create_localrpcb_create_local_unixrpc_createxprt_create_transportxs_setup_localxs_local_setup_socket__sock_createxs_local_finish_connecting // 失败返回,但是没有释放socket 同步hulk 补丁: 分析: 【对外部(配置、头文件、外部函数)是否有影响】 否
Comments (
2
)
Sign in
to comment
Status
Done
Backlog
已挂起
Fixing
Confirmed
Done
Accepted
Canceled
Assignees
Not set
Labels
sig/Kernel
Not set
Projects
Unprojected
Unprojected
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(3)
1
https://gitee.com/src-openeuler/kernel.git
git@gitee.com:src-openeuler/kernel.git
src-openeuler
kernel
kernel
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register