Skip to content

Commit faada25

Browse files
committed
tiny
1 parent add56f3 commit faada25

7 files changed

Lines changed: 13 additions & 10 deletions

File tree

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'tasks/readme.rake'
1010
task default: %i(readme rubocop compile spec)
1111

1212
RuboCop::RakeTask.new(:rubocop) do |task|
13-
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'bin/*', 'tasks/*']
13+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'bin/*', 'tasks/*.rake']
1414
end
1515

1616
RSpec::Core::RakeTask.new(:spec)

lib/seccomp-tools/asm/asm.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ module Asm
1010

1111
# Assembler of seccomp bpf.
1212
# @param [String] str
13+
# @param [:amd64, :i386] arch
1314
# @return [String]
1415
# Raw bpf bytes.
1516
# @example
16-
# asm(<<EOS)
17+
# SeccompTools::Asm.asm(<<-EOS)
1718
# # lines start with '#' are comments
1819
# A = sys_number # here's a comment, too
1920
# A >= 0x40000000 ? dead : next # 'next' is a keyword, denote the next instruction

lib/seccomp-tools/consts/sys_nr/amd64.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
rt_sigprocmask: 14,
1919
rt_sigreturn: 15,
2020
ioctl: 16,
21-
pread: 17,
22-
pwrite: 18,
21+
pread64: 17,
22+
pwrite64: 18,
2323
readv: 19,
2424
writev: 20,
2525
access: 21,

lib/seccomp-tools/consts/sys_nr/i386.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
{
4+
setup: 0,
45
exit: 1,
56
fork: 2,
67
read: 3,
@@ -180,8 +181,8 @@
180181
rt_sigtimedwait: 177,
181182
rt_sigqueueinfo: 178,
182183
rt_sigsuspend: 179,
183-
pread: 180,
184-
pwrite: 181,
184+
pread64: 180,
185+
pwrite64: 181,
185186
chown: 182,
186187
getcwd: 183,
187188
capget: 184,

lib/seccomp-tools/disasm/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def store(idx, reg)
9696
values[idx] = values[reg.downcase.to_sym]
9797
end
9898

99-
# Hints context that current value of register A is equals to +val+.
99+
# Hints context that current value of register A equals to +val+.
100100
#
101101
# @param [Integer, :x] val
102102
# An immediate value or the symbol x.

spec/disasm/context_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
expect(ctx.x.val).to be_zero
5757
end
5858

59-
it 'known_eql' do
59+
it 'known_data' do
6060
ctx = described_class.new
6161
ctx.load(:a, rel: :data, val: 0)
6262
ctx.eql!(1337)

tasks/syscalls_complement.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Complement of syscalls without parameters' names */
1+
/* Some syscalls in syscalls.h only have prototypes but no argument names, we add them here. */
22
asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, struct iocb __user * __user *iocbpp);
33
asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
44
struct __kernel_timespec __user *tsp, void __user *sig);
@@ -33,11 +33,12 @@ asmlinkage long sys_old_readdir(unsigned int fd, struct old_linux_dirent __user
3333
asmlinkage long sys_uname(struct old_utsname __user *name);
3434
asmlinkage long sys_olduname(struct oldold_utsname __user *name);
3535

36-
/* Add manually */
36+
/* Syscalls not appear in syscalls.h. */
3737
asmlinkage long sys_arch_prctl(int code, unsigned long addr);
3838
asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
3939
unsigned long fd, unsigned long pgoff);
4040

41+
/* to have i386 compatiable */
4142
asmlinkage long sys__llseek(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t __user *result,
4243
unsigned int whence);
4344
asmlinkage long sys__sysctl(struct __sysctl_args __user *args);

0 commit comments

Comments
 (0)