lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iMOJ-mHL6hUUWs+kuq=4C=_DGUM5b9=jHUp=qnEB2Gqg@mail.gmail.com>
Date:   Wed, 16 Feb 2022 19:48:58 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Ye Bin <yebin10@...wei.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
        Linux PM <linux-pm@...r.kernel.org>,
        "Ted Ts'o" <tytso@....edu>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jan Kara <jack@...e.cz>
Subject: Re: [PATCH -next] PM:hibernate:fix miss close 'hib_resume_bdev' in load_image_and_restore

On Wed, Feb 9, 2022 at 12:13 PM Ye Bin <yebin10@...wei.com> wrote:
>
> As 'swsusp_check' open 'hib_resume_bdev', if call 'create_basic_memory_bitmaps'
> failed, we need to close 'hib_resume_bdev' in 'load_image_and_restore' function.
>
> Signed-off-by: Ye Bin <yebin10@...wei.com>
> ---
>  kernel/power/hibernate.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e6af502c2fd7..49d1df0218cb 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -689,8 +689,10 @@ static int load_image_and_restore(void)
>
>         lock_device_hotplug();
>         error = create_basic_memory_bitmaps();
> -       if (error)
> +       if (error) {
> +               swsusp_close(FMODE_READ | FMODE_EXCL);
>                 goto Unlock;
> +       }
>
>         error = swsusp_read(&flags);
>         swsusp_close(FMODE_READ | FMODE_EXCL);
> --

Applied as 5.18 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ