[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202110210903.64145A81@keescook>
Date: Thu, 21 Oct 2021 09:05:03 -0700
From: Kees Cook <keescook@...omium.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 03/20] reboot: Remove the unreachable panic after do_exit
in reboot(2)
On Wed, Oct 20, 2021 at 12:43:49PM -0500, Eric W. Biederman wrote:
> Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>
> ---
> kernel/reboot.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index f7440c0c7e43..d6e0f9fb7f04 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -359,7 +359,6 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
> case LINUX_REBOOT_CMD_HALT:
> kernel_halt();
> do_exit(0);
> - panic("cannot halt");
This looks like it was here for robustness (i.e. panic if do_exit
somehow fails)? But since do_exit() is marked __no_return, it doesn't
make sense to keep it. If we wanted to keep _something_ here, maybe just
add unreachable() ?
Reviewed-by: Kees Cook <keescook@...omium.org>
>
> case LINUX_REBOOT_CMD_POWER_OFF:
> kernel_power_off();
> --
> 2.20.1
>
--
Kees Cook
Powered by blists - more mailing lists