linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/signal: Modify the comment of function check_kill_permission
@ 2021-03-23  8:03 zhouchuangao
  2021-03-23  8:59 ` Christian Brauner
  0 siblings, 1 reply; 3+ messages in thread
From: zhouchuangao @ 2021-03-23  8:03 UTC (permalink / raw)
  To: Jens Axboe, Christian Brauner, Eric W. Biederman, Oleg Nesterov,
	Peter Collingbourne, Zhiqiang Liu, linux-kernel
  Cc: zhouchuangao

Maybe it's easier for us to understand the function of
check_kill_permission.

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
 kernel/signal.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index f2a1b89..2fbf68a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -823,8 +823,10 @@ static bool kill_ok_by_cred(struct task_struct *t)
 }
 
 /*
- * Bad permissions for sending the signal
- * - the caller must hold the RCU read lock
+ * Check if the signal has permission to kill the process.
+ * - The caller must hold the RCU read lock;
+ * - Return 0 means permission is allowed, otherwise returns the
+ *   corresponding error number.
  */
 static int check_kill_permission(int sig, struct kernel_siginfo *info,
 				 struct task_struct *t)
-- 
2.7.4


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

* Re: [PATCH] kernel/signal: Modify the comment of function check_kill_permission
  2021-03-23  8:03 [PATCH] kernel/signal: Modify the comment of function check_kill_permission zhouchuangao
@ 2021-03-23  8:59 ` Christian Brauner
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2021-03-23  8:59 UTC (permalink / raw)
  To: zhouchuangao
  Cc: Jens Axboe, Eric W. Biederman, Oleg Nesterov,
	Peter Collingbourne, Zhiqiang Liu, linux-kernel

On Tue, Mar 23, 2021 at 01:03:56AM -0700, zhouchuangao wrote:
> Maybe it's easier for us to understand the function of
> check_kill_permission.
> 
> Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
> ---
>  kernel/signal.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/signal.c b/kernel/signal.c
> index f2a1b89..2fbf68a 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -823,8 +823,10 @@ static bool kill_ok_by_cred(struct task_struct *t)
>  }
>  
>  /*
> - * Bad permissions for sending the signal
> - * - the caller must hold the RCU read lock
> + * Check if the signal has permission to kill the process.

Hey,

This phrasing is misleading imho. It's not about whether the signal has
permission but whether the caller has permissions to send the signal.

Christian

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

* [PATCH] kernel/signal: Modify the comment of function check_kill_permission
@ 2021-05-10  1:26 zhouchuangao
  0 siblings, 0 replies; 3+ messages in thread
From: zhouchuangao @ 2021-05-10  1:26 UTC (permalink / raw)
  To: Jens Axboe, Oleg Nesterov, Eric W. Biederman,
	Peter Zijlstra (Intel),
	Thomas Gleixner, Peter Collingbourne, Marco Elver, linux-kernel
  Cc: zhouchuangao

Maybe it's easier for us to understand the function of
check_kill_permission().

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
---
 kernel/signal.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 66e8864..8335f17 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -861,8 +861,10 @@ static bool kill_ok_by_cred(struct task_struct *t)
 }
 
 /*
- * Bad permissions for sending the signal
- * - the caller must hold the RCU read lock
+ * Check whether the caller has permissions to send the signal.
+ * - The caller must hold the RCU read lock;
+ * - Return 0 means permission is allowed, otherwise returns the
+ *   corresponding error number.
  */
 static int check_kill_permission(int sig, struct kernel_siginfo *info,
 				 struct task_struct *t)
-- 
2.7.4


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

end of thread, other threads:[~2021-05-10  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  8:03 [PATCH] kernel/signal: Modify the comment of function check_kill_permission zhouchuangao
2021-03-23  8:59 ` Christian Brauner
2021-05-10  1:26 zhouchuangao

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).