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]
Date:   Fri, 10 Feb 2023 11:31:54 +0000
From:   Daniel P. Berrangé <berrange@...hat.com>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     qemu-devel@...gnu.org, x86@...nel.org,
        linux-kernel@...r.kernel.org, Dov Murik <dovmurik@...ux.ibm.com>,
        Tom Lendacky <thomas.lendacky@....com>,
        Gerd Hoffmann <kraxel@...hat.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Richard Henderson <richard.henderson@...aro.org>,
        "H . Peter Anvin" <hpa@...or.com>,
        Philippe Mathieu-Daudé <philmd@...aro.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Borislav Petkov <bp@...en8.de>,
        Eric Biggers <ebiggers@...nel.org>,
        Marcel Apfelbaum <marcel.apfelbaum@...il.com>,
        Eduardo Habkost <eduardo@...kost.net>
Subject: Re: [PATCH RFC 6/7] Revert "x86: return modified setup_data only if
 read as memory, not as file"

On Thu, Feb 09, 2023 at 04:52:32PM +0100, Jason A. Donenfeld wrote:
> On Wed, Feb 08, 2023 at 04:12:51PM -0500, Michael S. Tsirkin wrote:
> > This reverts commit e935b735085dfa61d8e6d276b6f9e7687796a3c7.
> > 
> > Fixes: e935b73508 ("x86: return modified setup_data only if read as memory, not as file")
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> > ---
> >  include/hw/nvram/fw_cfg.h | 22 -------------------
> >  hw/i386/x86.c             | 46 +++++++++------------------------------
> >  hw/nvram/fw_cfg.c         | 12 +++++-----
> >  3 files changed, 16 insertions(+), 64 deletions(-)
> > 
> > diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> > index 2e503904dc..c1f81a5f13 100644
> > --- a/include/hw/nvram/fw_cfg.h
> > +++ b/include/hw/nvram/fw_cfg.h
> > @@ -117,28 +117,6 @@ struct FWCfgMemState {
> >   */
> >  void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len);
> >  
> > -/**
> > - * fw_cfg_add_bytes_callback:
> > - * @s: fw_cfg device being modified
> > - * @key: selector key value for new fw_cfg item
> > - * @select_cb: callback function when selecting
> > - * @write_cb: callback function after a write
> > - * @callback_opaque: argument to be passed into callback function
> > - * @data: pointer to start of item data
> > - * @len: size of item data
> > - * @read_only: is file read only
> > - *
> > - * Add a new fw_cfg item, available by selecting the given key, as a raw
> > - * "blob" of the given size. The data referenced by the starting pointer
> > - * is only linked, NOT copied, into the data structure of the fw_cfg device.
> > - */
> > -void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key,
> > -                               FWCfgCallback select_cb,
> > -                               FWCfgWriteCallback write_cb,
> > -                               void *callback_opaque,
> > -                               void *data, size_t len,
> > -                               bool read_only);
> > -
> >  /**
> >   * fw_cfg_add_string:
> >   * @s: fw_cfg device being modified
> > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> > index a00881bc64..29a5bef1d5 100644
> > --- a/hw/nvram/fw_cfg.c
> > +++ b/hw/nvram/fw_cfg.c
> > @@ -693,12 +693,12 @@ static const VMStateDescription vmstate_fw_cfg = {
> >      }
> >  };
> >  
> > -void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key,
> > -                               FWCfgCallback select_cb,
> > -                               FWCfgWriteCallback write_cb,
> > -                               void *callback_opaque,
> > -                               void *data, size_t len,
> > -                               bool read_only)
> > +static void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key,
> > +                                      FWCfgCallback select_cb,
> > +                                      FWCfgWriteCallback write_cb,
> > +                                      void *callback_opaque,
> > +                                      void *data, size_t len,
> > +                                      bool read_only)
> >  {
> >      int arch = !!(key & FW_CFG_ARCH_LOCAL);
> 
> Could you leave these snippets in? This function is useful and will be
> needed in the reprise.

IMHO it is better to do a full clean revert of the patches.

Switching this one function from static to public is trivial
enough that it is not burden to do in a new impl of the RNG
seed work.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ