[PATCH] selinux:Delete selinux_xfrm_policy_lookup() useless argument

2021-04-08 Thread  Zhongjun Tan
From: Zhongjun Tan Delete selinux selinux_xfrm_policy_lookup() useless argument. Signed-off-by: Zhongjun Tan --- include/linux/lsm_hook_defs.h | 3 +-- include/linux/security.h| 4 ++-- net/xfrm/xfrm_policy.c | 6 ++ security/security.c | 4 ++-- security

[PATCH] selinux:Delete selinux_xfrm_policy_lookup() useless argument

2021-04-08 Thread  Zhongjun Tan
From: Zhongjun Tan Delete selinux selinux_xfrm_policy_lookup() useless argument. Signed-off-by: Zhongjun Tan --- include/linux/lsm_hook_defs.h | 3 +-- include/linux/security.h| 4 ++-- net/xfrm/xfrm_policy.c | 6 ++ security/security.c | 4 ++-- security

[PATCH 2/2] selinux:Delete selinux_xfrm_policy_lookup() useless argument

2021-04-08 Thread  Zhongjun Tan
From: Zhongjun Tan seliunx_xfrm_policy_lookup() is hooks of security_xfrm_policy_lookup(). The dir argument is uselss in security_xfrm_policy_lookup(). So remove the dir argument from selinux_xfrm_policy_lookup() and security_xfrm_policy_lookup(). Signed-off-by: Zhongjun Tan --- include/linux

[PATCH] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()

2021-04-16 Thread  Zhongjun Tan
From: Zhongjun Tan In smack_sb_eat_lsm_opts(), 'arg' is allocated by kmemdup_nul(). It returns NULL when fails. So 'arg' should be checked. And 'mnt_opts' should be freed when error. Signed-off-by: Zhongjun Tan --- security/smack/smack_lsm.c | 19 +

[PATCH v2] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()

2021-04-16 Thread  Zhongjun Tan
From: Zhongjun Tan In smack_sb_eat_lsm_opts(), 'arg' is allocated by kmemdup_nul(). It returns NULL when fails. So 'arg' should be checked. And 'mnt_opts' should be freed when error. Signed-off-by: Zhongjun Tan --- v2:fix brace error security/smack/smack_lsm

[PATCH v3] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()

2021-04-18 Thread  Zhongjun Tan
From: Zhongjun Tan In smack_sb_eat_lsm_opts(), 'arg' is allocated by kmemdup_nul(). It returns NULL when fails. So 'arg' should be checked. And 'mnt_opts' should be freed when error. Signed-off-by: Zhongjun Tan --- changes in v1: update the commit information.

Re: [PATCH] lsm:fix a missing-check bug in smack_sb_eat_lsm_opts()

2021-04-18 Thread Zhongjun Tan
On Fri, 16 Apr 2021 13:36:01 + Al Viro wrote: > On Fri, Apr 16, 2021 at 05:53:03PM +0800, ?0?2Zhongjun Tan wrote: > > > @@ -710,13 +711,14 @@ static int smack_sb_eat_lsm_opts(char > > *options, void **mnt_opts) token = match_opt_prefix(from, len, > > &arg); if (token != Opt_error) { > >