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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190204145244.GJ31132@infradead.org>
Date:   Mon, 4 Feb 2019 06:52:44 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     David Kozub <zub@...ux.fjfi.cvut.cz>
Cc:     Jens Axboe <axboe@...nel.dk>,
        Jonathan Derrick <jonathan.derrick@...el.com>,
        Scott Bauer <sbauer@...donthack.me>,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
Subject: Re: [PATCH v4 10/16] block: sed-opal: add ioctl for done-mark of
 shadow mbr

On Fri, Feb 01, 2019 at 09:50:17PM +0100, David Kozub wrote:
> From: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
> 
> Enable users to mark the shadow mbr as done without completely
> deactivating the shadow mbr feature. This may be useful on reboots,
> when the power to the disk is not disconnected in between and the shadow
> mbr stores the required boot files. Of course, this saves also the
> (few) commands required to enable the feature if it is already enabled
> and one only wants to mark the shadow mbr as done.
> 
> Signed-off-by: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
> Reviewed-by: Scott Bauer <sbauer@...donthack.me>
> ---
>  block/sed-opal.c              | 33 +++++++++++++++++++++++++++++++--
>  include/linux/sed-opal.h      |  1 +
>  include/uapi/linux/sed-opal.h |  1 +
>  3 files changed, 33 insertions(+), 2 deletions(-)
> 
> diff --git a/block/sed-opal.c b/block/sed-opal.c
> index 4b0a63b9d7c9..e03838cfd31b 100644
> --- a/block/sed-opal.c
> +++ b/block/sed-opal.c
> @@ -1996,13 +1996,39 @@ static int opal_erase_locking_range(struct opal_dev *dev,
>  static int opal_enable_disable_shadow_mbr(struct opal_dev *dev,
>  					  struct opal_mbr_data *opal_mbr)
>  {
> +	u8 token = opal_mbr->enable_disable == OPAL_MBR_ENABLE
> +		? OPAL_TRUE : OPAL_FALSE;
>  	const struct opal_step mbr_steps[] = {
>  		{ opal_discovery0, },
>  		{ start_admin1LSP_opal_session, &opal_mbr->key },
> -		{ set_mbr_done, &opal_mbr->enable_disable },
> +		{ set_mbr_done, &token },
>  		{ end_opal_session, },
>  		{ start_admin1LSP_opal_session, &opal_mbr->key },
> -		{ set_mbr_enable_disable, &opal_mbr->enable_disable },
> +		{ set_mbr_enable_disable, &token },
> +		{ end_opal_session, },
> +		{ NULL, }

This seems to be a change of what we pass to set_mbr_done /
set_mbr_enable_disable and not really related to the new functionality
here, so it should be split into a separate patch.

That being said if we really care about this translation between
the two sets of constants, why not do it inside
set_mbr_done and set_mbr_enable_disable?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ