sendfile violates I/O-safety
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
阅读 src/sys/unix.rs 中链接的 Socket::sendfile 实现附近的代码,并将其文件描述符 bound 与 PR #325 中 SockRef::from 的改动进行比较。更新 sendfile,使其使用 issue 中描述的 I/O 安全描述符 trait,然后运行相关的 socket2 测试。完成标准是 API 不再通过 AsRawFd 接受原始描述符。
由索引模型根据 Issue 内容生成。
描述
Hi, I was scanning code for I/O safety violations, and found that Socket::sendfile violates I/O safety since it operates on raw fd while being declared safe:
I found that there have been an issue #218 pointing out that SockRef::from and sendfile are not I/O safe. However, that issue has been marked as fixed by pr #325, which only fixes SockRef::from, and sendfile is still not I/O safe in current latest version.
To fix it, I guess we can just do what #325 does: require F: AsFd instead of F: AsRawFd.
- 主要语言
- Rust
- 星标
- 885
- 派生
- 328
- 平均合并
- 6 天 12 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-lang/socket2 的其他 Issue
-
Commit lockfile未关闭
难度 2/5 1-3 小时 新手友好度 65/100
rust-lang/socket2#703 · 1 条评论 ·
维护者通常 1 天内回复
-
windows-sys 0.101.0可能已有人在做 @xtqqczze 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
SockAddr::path_len doesn't bound the length by sun_path: as_pathname panics since #691, as_abstract_namespace slices past it可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
`from_timeval` overflows on a non-normalised `tv_usec`可能已有人在做 @pederbe 于 18 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Build fails on 32-bit glibc (i686, armv7) with libc's `--cfg=libc_unstable_time64`: `tv_usec` is cast to `suseconds_t` (i32) for an i64 field可能已有人在做 @omrzk 于 28 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
rust-lang/socket2#684 · 1 条评论 ·
维护者通常 1 天内回复
查看 rust-lang/socket2 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
infra
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
available bug good first issue tooling
难度 2/5 1-3 小时 新手友好度 78/100
Nixitov/Riptide-Native#817 ·
维护者通常 1 天内回复