Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update seccomp program #536

Closed
wants to merge 14 commits into from
Closed

Conversation

sat0ken
Copy link

@sat0ken sat0ken commented Sep 2, 2024

以下のissueを進めるため、Seccompのサンプルプログラムを改造しました

youki-dev#2724

Copy link
Owner

@utam0k utam0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ nits

Comment on lines 206 to 217
if arc == &Arch::X86 {
match syscalls::x86_64::Sysno::from_str(name) {
Ok(syscall) => Some(syscall as u64),
Err(_) => None,
}
} else {
match syscalls::aarch64::Sysno::from_str(name) {
Ok(syscall) => Some(syscall as u64),
Err(_) => None,
}
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今後もアーキテクチャが増えることは容易に想像つくので match にしておきますか。

Copy link
Author

@sat0ken sat0ken Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応遅くなってすみません、以下で修正しました m( - - )m

efcaef1

}
}

pub fn to_instruction(arch: &Arch, action: u32, rule: &Rule) -> Vec<Instruction> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Fromを提案しておいてなんですが、無理せずこれでも十分使いやすいインタフェースだと思います。ありがとうございます。

pub is_notify: bool
}

impl Rule {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もし可能だったら別PRでもいいですし、他の方でもいいんですが unit テスト足したいですね。

Copy link
Author

@sat0ken sat0ken Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit テストの書き方がまだわからないので、別PRで対応致しますm(- -)m

@utam0k
Copy link
Owner

utam0k commented Sep 23, 2024

cargo clippy をかけておくくらいをついでに直してもらえるとはっぴーです!

@sat0ken
Copy link
Author

sat0ken commented Oct 2, 2024

以下で cargo clipy で怒られたところを修正しておきました

efcaef1

@sat0ken sat0ken force-pushed the update-seccomp-program branch from af3c009 to a2c7dc8 Compare October 4, 2024 15:19
Gekko0114 and others added 13 commits October 5, 2024 00:30
* added selinux functions

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* not use arc

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* follow reviewer comment

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* divided selinux impl into two files

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* fix

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* fix

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* fix

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use SELinuxLabel struct

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* use pointer instead of clone

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* not loop

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

* add main.rs

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>

---------

Signed-off-by: Hiroyuki Moriya <41197469+Gekko0114@users.noreply.github.com>
Bumps the patch group with 3 updates: [serde](https://github.com/serde-rs/serde), [libc](https://github.com/rust-lang/libc) and [serde_json](https://github.com/serde-rs/json).


Updates `serde` from 1.0.207 to 1.0.208
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.207...v1.0.208)

Updates `libc` from 0.2.155 to 0.2.156
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.156/CHANGELOG.md)
- [Commits](rust-lang/libc@0.2.155...0.2.156)

Updates `serde_json` from 1.0.124 to 1.0.125
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](serde-rs/json@v1.0.124...1.0.125)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
…ch64

Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken sat0ken force-pushed the update-seccomp-program branch from a2c7dc8 to a7a842b Compare October 4, 2024 15:31
Signed-off-by: sat0ken <15720506+sat0ken@users.noreply.github.com>
@sat0ken sat0ken force-pushed the update-seccomp-program branch from a7a842b to 43bcdfa Compare October 4, 2024 15:34
@utam0k
Copy link
Owner

utam0k commented Oct 7, 2024

@sat0ken Unfortunately, there are a lot of conflicts with the main branch. May I ask you to solve it?

@utam0k
Copy link
Owner

utam0k commented Oct 7, 2024

あ、ここは youki 向きじゃなかったですね。 Close します。

@utam0k utam0k closed this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants