登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
代码拉取完成,页面将自动刷新
仓库状态说明
开源项目
>
其他开源
>
操作系统
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
458
Star
1.7K
Fork
1.9K
GVP
openEuler
/
kernel
关闭
代码
Issues
1271
Pull Requests
991
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
hns3 驱动无法处理含有 SOF_TIMESTAMPING_TX_HARDWARE 标志位的 flag 的网络包
已完成
#IABWUI
缺陷
martins3
创建于
2024-07-10 12:47
**一、缺陷信息** **内核信息:** 5.10.0-216.0.0.115.oe2203sp4.aarch64 **缺陷归属组件:** hns3 网卡驱动 **缺陷归属的版本:** OLK-5.10 **缺陷简述:** **【环境信息】** - 服务器 : KunTai R722 - 网卡信息 ```txt [smartx@node1960 12:32:41 ~]$ ethtool -i enp125s0f0 driver: hns3 version: 5.10.0-216.0.0.115.oe2203sp4.aa firmware-version: 1.10.0.6 expansion-rom-version: bus-info: 0000:7d:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: no supports-register-dump: yes supports-priv-flags: yes ``` **【问题复现步骤】** 1. 将如下源码拷贝到 hns3 机器的上,该机器作为 client 端。 ```c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <linux/net_tstamp.h> #include <netdb.h> #define UDP_PORTNO 11346 #define BUFSIZE 1024 /* * error - wrapper for perror */ void error(char *msg) { perror(msg); exit(0); } int main(int argc, char **argv) { int sockfd, portno = UDP_PORTNO, n; unsigned int serverlen; struct sockaddr_in serveraddr; struct hostent *server; char *hostname = "10.0.0.108"; char buf[BUFSIZE]; /* check command line arguments */ if (argc != 2) error("./udp_client [hostname]\n"); hostname = argv[1]; /* socket: create the socket */ sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) error("ERROR opening socket"); int flags = SOF_TIMESTAMPING_TX_HARDWARE; int ret = setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING, &flags, sizeof(flags)); if (ret == -1) error("setsockopt"); server = gethostbyname(hostname); if (server == NULL) error("ERROR, no such host\n"); /* build the server's Internet address */ bzero((char *)&serveraddr, sizeof(serveraddr)); serveraddr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serveraddr.sin_addr.s_addr, server->h_length); serveraddr.sin_port = htons(portno); bzero(buf, BUFSIZE); sprintf(buf, ".\n"); /* send the message to the server */ serverlen = sizeof(serveraddr); n = sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&serveraddr, serverlen); if (n < 0) error("ERROR in sendto"); return 0; } ``` 2. 在另外一个一台机器上执行 `nc -u -l 11346` 作为 server 端,需要保证 client 可以通过 hns 网卡联通 server 端口,假设 server 的 ip 为 192.168.67.23 3. clinet 上编译并且执行 ./a.out 192.168.67.23 **kernel dmesg** ```txt [ 128.087798][T13532] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 [ 128.097282][T13532] Mem abort info: [ 128.100772][T13532] ESR = 0x96000006 [ 128.104519][T13532] EC = 0x25: DABT (current EL), IL = 32 bits [ 128.110520][T13532] SET = 0, FnV = 0 [ 128.114266][T13532] EA = 0, S1PTW = 0 [ 128.118102][T13532] Data abort info: [ 128.121673][T13532] ISV = 0, ISS = 0x00000006 [ 128.126197][T13532] CM = 0, WnR = 0 [ 128.130045][T13532] user pgtable: 4k pages, 48-bit VAs, pgdp=0000003eb4831000 [ 128.137319][T13532] [0000000000000018] pgd=0000003db59f0003, p4d=0000003db59f0003, pud=0000003eb2bb2003, pmd=0000000000000000 [ 128.148889][T13532] Internal error: Oops: 0000000096000006 [#1] SMP [ 128.155281][T13532] Modules linked in: nfsv3 nfs_acl nfs lockd grace nfs_ssc fscache xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 ip6table_mangle ip6table_nat iptable_mangle iptable_nat ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter tun bridge stp llc scsi_transport_iscsi overlay nfnetlink_cttimeout nfnetlink openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c sunrpc vfat fat loop bonding ipmi_ssif aes_ce_blk ses crypto_simd enclosure cryptd aes_ce_cipher ghash_ce sha1_ce sbsa_gwdt hns_roce_hw_v2 ib_uverbs sg ib_core hibmc_drm drm_vram_helper drm_ttm_helper ttm hisi_uncore_hha_pmu hisi_uncore_ddrc_pmu hisi_uncore_l3c_pmu hisi_uncore_pmu acpi_ipmi sch_fq_codel ipmi_si ipmi_devintf ipmi_msghandler ip_tables ext4 mbcache jbd2 raid1 realtek hclge sd_mod hisi_sas_v3_hw hisi_sas_main mlx5_core ahci sha2_ce libsas nvme sha256_arm64 libahci hns3 megaraid_sas nvme_core libata mlxfw t10_pi hnae3 host_edma_drv [ 128.155360][T13532] scsi_transport_sas nfit i2c_designware_platform i2c_designware_core libnvdimm fuse [ 128.253541][T13532] CPU: 3 PID: 13532 Comm: a.out Kdump: loaded Not tainted 5.10.0-216.0.0.115.oe2203sp4.aarch64 #1 [ 128.264442][T13532] Hardware name: Yunke China KunTai R722/BC82AMDDRA, BIOS 1.89 05/20/2022 [ 128.273280][T13532] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--) [ 128.280251][T13532] pc : hclge_ptp_set_tx_info+0x2c/0x140 [hclge] [ 128.286600][T13532] lr : hclge_ptp_set_tx_info+0x20/0x140 [hclge] [ 128.292938][T13532] sp : ffff800059b93140 [ 128.297200][T13532] x29: ffff800059b93140 x28: 0000000000003280 [ 128.303455][T13532] x27: ffff800020d48280 x26: ffff0cb9dc814080 [ 128.309715][T13532] x25: ffff0cb9cde93fa0 x24: 0000000000000001 [ 128.315969][T13532] x23: 0000000000000000 x22: 0000000000000194 [ 128.322219][T13532] x21: ffff0cd94f986000 x20: 0000000000000000 [ 128.328462][T13532] x19: ffff0cb9d2a166c0 x18: 0000000000000000 [ 128.334698][T13532] x17: 0000000000000000 x16: ffffcf1fc523ed24 [ 128.340934][T13532] x15: 0000ffffd530a518 x14: 0000000000000000 [ 128.347162][T13532] x13: ffff0cd6bdb31310 x12: 0000000000000368 [ 128.353388][T13532] x11: ffff0cb9cfbc7070 x10: ffff2cf55dd11e02 [ 128.359606][T13532] x9 : ffffcf1f85a212b4 x8 : ffff0cd7cf27dab0 [ 128.365831][T13532] x7 : 0000000000000a20 x6 : ffff0cd7cf27d000 [ 128.372040][T13532] x5 : 0000000000000000 x4 : 000000000000ffff [ 128.378243][T13532] x3 : 0000000000000400 x2 : ffffcf1f85a21294 [ 128.384437][T13532] x1 : ffff0cb9db520080 x0 : ffff0cb9db500080 [ 128.390626][T13532] Call trace: [ 128.393964][T13532] hclge_ptp_set_tx_info+0x2c/0x140 [hclge] [ 128.399893][T13532] hns3_nic_net_xmit+0x39c/0x4c4 [hns3] [ 128.405468][T13532] xmit_one.constprop.0+0xc4/0x200 [ 128.410600][T13532] dev_hard_start_xmit+0x54/0xf0 [ 128.415556][T13532] sch_direct_xmit+0xe8/0x634 [ 128.420246][T13532] __dev_queue_xmit+0x224/0xc70 [ 128.425101][T13532] dev_queue_xmit+0x1c/0x40 [ 128.429608][T13532] ovs_vport_send+0xac/0x1a0 [openvswitch] [ 128.435409][T13532] do_output+0x60/0x17c [openvswitch] [ 128.440770][T13532] do_execute_actions+0x898/0x8c4 [openvswitch] [ 128.446993][T13532] ovs_execute_actions+0x64/0xf0 [openvswitch] [ 128.453129][T13532] ovs_dp_process_packet+0xa0/0x224 [openvswitch] [ 128.459530][T13532] ovs_vport_receive+0x7c/0xfc [openvswitch] [ 128.465497][T13532] internal_dev_xmit+0x34/0xb0 [openvswitch] [ 128.471460][T13532] xmit_one.constprop.0+0xc4/0x200 [ 128.476561][T13532] dev_hard_start_xmit+0x54/0xf0 [ 128.481489][T13532] __dev_queue_xmit+0x968/0xc70 [ 128.486330][T13532] dev_queue_xmit+0x1c/0x40 [ 128.490856][T13532] ip_finish_output2+0x250/0x570 [ 128.495810][T13532] __ip_finish_output+0x170/0x1e0 [ 128.500832][T13532] ip_finish_output+0x3c/0xf0 [ 128.505504][T13532] ip_output+0xbc/0x160 [ 128.509654][T13532] ip_send_skb+0x58/0xd4 [ 128.513892][T13532] udp_send_skb+0x12c/0x354 [ 128.518387][T13532] udp_sendmsg+0x7a8/0x9c0 [ 128.522793][T13532] inet_sendmsg+0x4c/0x8c [ 128.527116][T13532] __sock_sendmsg+0x48/0x80 [ 128.531609][T13532] __sys_sendto+0x124/0x164 [ 128.536099][T13532] __arm64_sys_sendto+0x30/0x5c [ 128.540935][T13532] invoke_syscall+0x50/0x130 [ 128.545508][T13532] el0_svc_common.constprop.0+0x10c/0x124 [ 128.551205][T13532] do_el0_svc+0x34/0xdc [ 128.555347][T13532] el0_svc+0x20/0x30 [ 128.559227][T13532] el0_sync_handler+0xb8/0xc0 [ 128.563883][T13532] el0_sync+0x160/0x180 [ 128.568019][T13532] Code: 97ff9ae9 f9412000 91408001 f945a834 (f9400e81) [ 128.574970][T13532] SMP: stopping secondary CPUs [ 128.582351][T13532] Starting crashdump kernel... [ 128.587114][T13532] Bye! ```
**一、缺陷信息** **内核信息:** 5.10.0-216.0.0.115.oe2203sp4.aarch64 **缺陷归属组件:** hns3 网卡驱动 **缺陷归属的版本:** OLK-5.10 **缺陷简述:** **【环境信息】** - 服务器 : KunTai R722 - 网卡信息 ```txt [smartx@node1960 12:32:41 ~]$ ethtool -i enp125s0f0 driver: hns3 version: 5.10.0-216.0.0.115.oe2203sp4.aa firmware-version: 1.10.0.6 expansion-rom-version: bus-info: 0000:7d:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: no supports-register-dump: yes supports-priv-flags: yes ``` **【问题复现步骤】** 1. 将如下源码拷贝到 hns3 机器的上,该机器作为 client 端。 ```c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <linux/net_tstamp.h> #include <netdb.h> #define UDP_PORTNO 11346 #define BUFSIZE 1024 /* * error - wrapper for perror */ void error(char *msg) { perror(msg); exit(0); } int main(int argc, char **argv) { int sockfd, portno = UDP_PORTNO, n; unsigned int serverlen; struct sockaddr_in serveraddr; struct hostent *server; char *hostname = "10.0.0.108"; char buf[BUFSIZE]; /* check command line arguments */ if (argc != 2) error("./udp_client [hostname]\n"); hostname = argv[1]; /* socket: create the socket */ sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) error("ERROR opening socket"); int flags = SOF_TIMESTAMPING_TX_HARDWARE; int ret = setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING, &flags, sizeof(flags)); if (ret == -1) error("setsockopt"); server = gethostbyname(hostname); if (server == NULL) error("ERROR, no such host\n"); /* build the server's Internet address */ bzero((char *)&serveraddr, sizeof(serveraddr)); serveraddr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serveraddr.sin_addr.s_addr, server->h_length); serveraddr.sin_port = htons(portno); bzero(buf, BUFSIZE); sprintf(buf, ".\n"); /* send the message to the server */ serverlen = sizeof(serveraddr); n = sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&serveraddr, serverlen); if (n < 0) error("ERROR in sendto"); return 0; } ``` 2. 在另外一个一台机器上执行 `nc -u -l 11346` 作为 server 端,需要保证 client 可以通过 hns 网卡联通 server 端口,假设 server 的 ip 为 192.168.67.23 3. clinet 上编译并且执行 ./a.out 192.168.67.23 **kernel dmesg** ```txt [ 128.087798][T13532] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018 [ 128.097282][T13532] Mem abort info: [ 128.100772][T13532] ESR = 0x96000006 [ 128.104519][T13532] EC = 0x25: DABT (current EL), IL = 32 bits [ 128.110520][T13532] SET = 0, FnV = 0 [ 128.114266][T13532] EA = 0, S1PTW = 0 [ 128.118102][T13532] Data abort info: [ 128.121673][T13532] ISV = 0, ISS = 0x00000006 [ 128.126197][T13532] CM = 0, WnR = 0 [ 128.130045][T13532] user pgtable: 4k pages, 48-bit VAs, pgdp=0000003eb4831000 [ 128.137319][T13532] [0000000000000018] pgd=0000003db59f0003, p4d=0000003db59f0003, pud=0000003eb2bb2003, pmd=0000000000000000 [ 128.148889][T13532] Internal error: Oops: 0000000096000006 [#1] SMP [ 128.155281][T13532] Modules linked in: nfsv3 nfs_acl nfs lockd grace nfs_ssc fscache xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 ip6table_mangle ip6table_nat iptable_mangle iptable_nat ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter tun bridge stp llc scsi_transport_iscsi overlay nfnetlink_cttimeout nfnetlink openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c sunrpc vfat fat loop bonding ipmi_ssif aes_ce_blk ses crypto_simd enclosure cryptd aes_ce_cipher ghash_ce sha1_ce sbsa_gwdt hns_roce_hw_v2 ib_uverbs sg ib_core hibmc_drm drm_vram_helper drm_ttm_helper ttm hisi_uncore_hha_pmu hisi_uncore_ddrc_pmu hisi_uncore_l3c_pmu hisi_uncore_pmu acpi_ipmi sch_fq_codel ipmi_si ipmi_devintf ipmi_msghandler ip_tables ext4 mbcache jbd2 raid1 realtek hclge sd_mod hisi_sas_v3_hw hisi_sas_main mlx5_core ahci sha2_ce libsas nvme sha256_arm64 libahci hns3 megaraid_sas nvme_core libata mlxfw t10_pi hnae3 host_edma_drv [ 128.155360][T13532] scsi_transport_sas nfit i2c_designware_platform i2c_designware_core libnvdimm fuse [ 128.253541][T13532] CPU: 3 PID: 13532 Comm: a.out Kdump: loaded Not tainted 5.10.0-216.0.0.115.oe2203sp4.aarch64 #1 [ 128.264442][T13532] Hardware name: Yunke China KunTai R722/BC82AMDDRA, BIOS 1.89 05/20/2022 [ 128.273280][T13532] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--) [ 128.280251][T13532] pc : hclge_ptp_set_tx_info+0x2c/0x140 [hclge] [ 128.286600][T13532] lr : hclge_ptp_set_tx_info+0x20/0x140 [hclge] [ 128.292938][T13532] sp : ffff800059b93140 [ 128.297200][T13532] x29: ffff800059b93140 x28: 0000000000003280 [ 128.303455][T13532] x27: ffff800020d48280 x26: ffff0cb9dc814080 [ 128.309715][T13532] x25: ffff0cb9cde93fa0 x24: 0000000000000001 [ 128.315969][T13532] x23: 0000000000000000 x22: 0000000000000194 [ 128.322219][T13532] x21: ffff0cd94f986000 x20: 0000000000000000 [ 128.328462][T13532] x19: ffff0cb9d2a166c0 x18: 0000000000000000 [ 128.334698][T13532] x17: 0000000000000000 x16: ffffcf1fc523ed24 [ 128.340934][T13532] x15: 0000ffffd530a518 x14: 0000000000000000 [ 128.347162][T13532] x13: ffff0cd6bdb31310 x12: 0000000000000368 [ 128.353388][T13532] x11: ffff0cb9cfbc7070 x10: ffff2cf55dd11e02 [ 128.359606][T13532] x9 : ffffcf1f85a212b4 x8 : ffff0cd7cf27dab0 [ 128.365831][T13532] x7 : 0000000000000a20 x6 : ffff0cd7cf27d000 [ 128.372040][T13532] x5 : 0000000000000000 x4 : 000000000000ffff [ 128.378243][T13532] x3 : 0000000000000400 x2 : ffffcf1f85a21294 [ 128.384437][T13532] x1 : ffff0cb9db520080 x0 : ffff0cb9db500080 [ 128.390626][T13532] Call trace: [ 128.393964][T13532] hclge_ptp_set_tx_info+0x2c/0x140 [hclge] [ 128.399893][T13532] hns3_nic_net_xmit+0x39c/0x4c4 [hns3] [ 128.405468][T13532] xmit_one.constprop.0+0xc4/0x200 [ 128.410600][T13532] dev_hard_start_xmit+0x54/0xf0 [ 128.415556][T13532] sch_direct_xmit+0xe8/0x634 [ 128.420246][T13532] __dev_queue_xmit+0x224/0xc70 [ 128.425101][T13532] dev_queue_xmit+0x1c/0x40 [ 128.429608][T13532] ovs_vport_send+0xac/0x1a0 [openvswitch] [ 128.435409][T13532] do_output+0x60/0x17c [openvswitch] [ 128.440770][T13532] do_execute_actions+0x898/0x8c4 [openvswitch] [ 128.446993][T13532] ovs_execute_actions+0x64/0xf0 [openvswitch] [ 128.453129][T13532] ovs_dp_process_packet+0xa0/0x224 [openvswitch] [ 128.459530][T13532] ovs_vport_receive+0x7c/0xfc [openvswitch] [ 128.465497][T13532] internal_dev_xmit+0x34/0xb0 [openvswitch] [ 128.471460][T13532] xmit_one.constprop.0+0xc4/0x200 [ 128.476561][T13532] dev_hard_start_xmit+0x54/0xf0 [ 128.481489][T13532] __dev_queue_xmit+0x968/0xc70 [ 128.486330][T13532] dev_queue_xmit+0x1c/0x40 [ 128.490856][T13532] ip_finish_output2+0x250/0x570 [ 128.495810][T13532] __ip_finish_output+0x170/0x1e0 [ 128.500832][T13532] ip_finish_output+0x3c/0xf0 [ 128.505504][T13532] ip_output+0xbc/0x160 [ 128.509654][T13532] ip_send_skb+0x58/0xd4 [ 128.513892][T13532] udp_send_skb+0x12c/0x354 [ 128.518387][T13532] udp_sendmsg+0x7a8/0x9c0 [ 128.522793][T13532] inet_sendmsg+0x4c/0x8c [ 128.527116][T13532] __sock_sendmsg+0x48/0x80 [ 128.531609][T13532] __sys_sendto+0x124/0x164 [ 128.536099][T13532] __arm64_sys_sendto+0x30/0x5c [ 128.540935][T13532] invoke_syscall+0x50/0x130 [ 128.545508][T13532] el0_svc_common.constprop.0+0x10c/0x124 [ 128.551205][T13532] do_el0_svc+0x34/0xdc [ 128.555347][T13532] el0_svc+0x20/0x30 [ 128.559227][T13532] el0_sync_handler+0xb8/0xc0 [ 128.563883][T13532] el0_sync+0x160/0x180 [ 128.568019][T13532] Code: 97ff9ae9 f9412000 91408001 f945a834 (f9400e81) [ 128.574970][T13532] SMP: stopping secondary CPUs [ 128.582351][T13532] Starting crashdump kernel... [ 128.587114][T13532] Bye! ```
评论 (
6
)
登录
后才可以发表评论
状态
已完成
待办的
已挂起
修复中
已确认
已完成
已验收
已取消
负责人
未设置
标签
sig/Kernel
未设置
项目
未立项任务
未立项任务
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(4)
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册