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: <a1b86dcb-8783-4038-83a9-278e5ddc109b@quicinc.com>
Date:   Tue, 3 Oct 2023 13:49:31 +0530
From:   Pavan Kondeti <quic_pkondeti@...cinc.com>
To:     Nikhil V <quic_nprakash@...cinc.com>
CC:     Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
        "Jonathan Corbet" <corbet@....net>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        "Catalin Marinas" <catalin.marinas@....com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Peter Zijlstra <peterz@...radead.org>,
        "Steven Rostedt (Google)" <rostedt@...dmis.org>,
        "Paul E. McKenney" <paulmck@...nel.org>, Tejun Heo <tj@...nel.org>,
        <linux-kernel@...r.kernel.org>, <linux-doc@...r.kernel.org>,
        <linux-pm@...r.kernel.org>, <quic_pkondeti@...cinc.com>,
        <quic_kprasan@...cinc.com>, <quic_mpilaniy@...cinc.com>,
        <quic_shrekk@...cinc.com>, <mpleshivenkov@...gle.com>,
        <ericyin@...gle.com>
Subject: Re: [RFC PATCH 4/4] PM: hibernate: Support to select compression
 algorithm

On Tue, Sep 26, 2023 at 02:27:14PM +0530, Nikhil V wrote:
> +static const char * const comp_alg_enabled[] = {
> +#if IS_ENABLED(CONFIG_CRYPTO_LZO)
> +	COMPRESSION_ALGO_LZO,
> +#endif
> +#if IS_ENABLED(CONFIG_CRYPTO_LZ4)
> +	COMPRESSION_ALGO_LZ4,
> +#endif
> +};
> +
> +static int __init compression_setup(char *str)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(comp_alg_enabled); i++) {
> +		if (!strcmp(str, comp_alg_enabled[i])) {
> +			strscpy(hib_comp_algo, str, sizeof(hib_comp_algo));
> +			goto setup_done;
> +		}
> +	}
> +	strscpy(hib_comp_algo, default_compressor, sizeof(hib_comp_algo));
> +
> +setup_done:
> +	return 1;
> +}
> +
>  __setup("noresume", noresume_setup);
>  __setup("resume_offset=", resume_offset_setup);
>  __setup("resume=", resume_setup);
> @@ -1423,3 +1449,4 @@ __setup("hibernate=", hibernate_setup);
>  __setup("resumewait", resumewait_setup);
>  __setup("resumedelay=", resumedelay_setup);
>  __setup("nohibernate", nohibernate_setup);
> +__setup("hib_compression=", compression_setup);
> -- 

If I pass hib_compression=lz4 without enabling CONFIG_CRYPTO_LZ4, It
silently makes the compression to lzo which is expected from this code.
It would be good if an error/info message is printed in
compression_setup() which this happens.

Thanks,
Pavan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ