bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* new seccomp mode aims to improve performance
@ 2020-05-29 12:48 zhujianwei (C)
  2020-05-29 15:43 ` Alexei Starovoitov
  0 siblings, 1 reply; 24+ messages in thread
From: zhujianwei (C) @ 2020-05-29 12:48 UTC (permalink / raw)
  To: bpf, linux-security-module; +Cc: Hehuazhen

Hi, all

  We're using seccomp to increase container security, but bpf rules filter causes performance to deteriorate. So, is there a good solution to improve performance, or can we add a simplified seccomp mode to improve performance?
  
  // Pseudo code
  int __secure_computing(int this_syscall)
  {
  	...
  	switch (mode) {
  	case SECCOMP_MODE_STRICT:
  		...
  	case SECCOMP_MODE_FILTER:
  		...
  	case SECCOMP_MODE_LIGHT_FILTER:
  		//do light syscall filter.
  		...
  		break;
  	}
  	...
  }
  		
  int light_syscall_filter(int syscall_num) {
  	if(scno > SYSNUM_MAX) {
  		...
  		return -EACCESS;
  	}
  
  	bool *filter_map = get_filter_map(current);
  	if(filter_map == NULL) {
  		...
  		return -EFAULT;
  	}
  
  	if(filter_map[syscall_num] == true) {
  		...
  		return 0;
  	} else {
  		...
  		return -EACCESS;
  	}
  	...
  }

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-06-16  6:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 12:48 new seccomp mode aims to improve performance zhujianwei (C)
2020-05-29 15:43 ` Alexei Starovoitov
2020-05-29 16:09   ` Kees Cook
2020-05-29 17:31     ` Alexei Starovoitov
2020-05-29 19:27     ` Kees Cook
2020-05-31 17:19       ` Alexei Starovoitov
2020-06-01 18:16         ` Kees Cook
2020-06-01  2:08       ` 答复: " zhujianwei (C)
2020-06-01  3:30         ` Alexei Starovoitov
2020-06-02  2:42           ` 答复: " zhujianwei (C)
2020-06-02  3:24             ` Alexei Starovoitov
2020-06-02 11:13               ` 答复: " zhujianwei (C)
2020-06-02 11:34               ` zhujianwei (C)
2020-06-02 18:32                 ` Kees Cook
2020-06-03  4:51                   ` 答复: " zhujianwei (C)
2020-06-01 10:11       ` Lennart Poettering
2020-06-01 12:32         ` Paul Moore
2020-06-02 12:53           ` Lennart Poettering
2020-06-02 15:03             ` Paul Moore
2020-06-02 18:39               ` Kees Cook
2020-06-01 18:21         ` Kees Cook
2020-06-02 12:44           ` Lennart Poettering
2020-06-02 18:37             ` Kees Cook
2020-06-16  6:00             ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).