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: <20230405070248.GA721439@hu-pkondeti-hyd.qualcomm.com>
Date:   Wed, 5 Apr 2023 12:32:48 +0530
From:   Pavan Kondeti <quic_pkondeti@...cinc.com>
To:     Chen Yu <yu.c.chen@...el.com>
CC:     Pavankumar Kondeti <quic_pkondeti@...cinc.com>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        Ye Bin <yebin10@...wei.com>,
        Nikhil V <quic_nprakash@...cinc.com>,
        <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM: hibernate: Get test_resume hibernation mode working
 again

On Wed, Apr 05, 2023 at 12:43:03PM +0800, Chen Yu wrote:
> Hi Pavankumar,
> On 2023-04-05 at 09:15:02 +0530, Pavankumar Kondeti wrote:
> > Commit 39fbef4b0f77 ("PM: hibernate: Get block device exclusively in
> > swsusp_check()") changed the opening mode of the block device to
> > (FMODE_READ | FMODE_EXCL) during resume. This breaks the test_resume
> > hibernation mode as the block device is not available for exclusive
> > open. Because the block device is configured as swap during hibernation.
> > 
> > Fix this issue by opening the device in FMODE_READ only in test_resume
> > restore path. Cache the flags used in opening the block device so that
> > callers of swsusp_close() does not need to worry about test_resume vs
> > normal restore.
> > 
> > Fixes: 39fbef4b0f77 ("PM: hibernate: Get block device exclusively in swsusp_check()")
> > Signed-off-by: Pavankumar Kondeti <quic_pkondeti@...cinc.com>
> > ---
> >  kernel/power/hibernate.c | 21 +++++++++++-----
> >  kernel/power/power.h     |  4 +--
> >  kernel/power/swap.c      | 53 +++++++++++++++++++++++-----------------
> >  3 files changed, 48 insertions(+), 30 deletions(-)
> >
> Thanks for taking a look at this, would the following fix make sense?
> https://lore.kernel.org/lkml/20230401165540.322665-1-yu.c.chen@intel.com/
> 

Thanks Chenyu for pointing it out.

Yes, your patch works. It looks good also. I left a minor comment. You
can probably clarify what "safe" means there either by a comment or
changing the variable name. I also left an alternative approach, I initially
started with.

Thanks,
Pavan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ