From: Igor Mammedov <imammedo@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, t0rr3sp3dr0@gmail.com,
alex.bennee@linaro.org, dgilbert@redhat.com, agraf@suse.de,
peter.maydell@linaro.org
Subject: Re: [PATCH for-7.1] applesmc: silence invalid key warning in case default one is used
Date: Thu, 28 Jul 2022 14:08:06 +0200 [thread overview]
Message-ID: <20220728140806.7e85b183@redhat.com> (raw)
In-Reply-To: <YuJbaxMbqNF+Cw65@redhat.com>
On Thu, 28 Jul 2022 10:48:27 +0100
Daniel P. Berrangé <berrange@redhat.com> wrote:
> On Thu, Jul 28, 2022 at 05:35:58AM -0400, Igor Mammedov wrote:
> > QEMU probably can't carry OSK key[1] for legal reasons so it
> > can't supply the valid default key. However when tests are run
> > applesmc will pollute test log with distracting warning,
> > silence that warning so it won't distract maintainers/CI.
>
> What test is causing this problem ?
>
> >
> > If user launches MacOS guest without supplying valid or any key
> > they will get upset MacOS (and legality of specifying valid key
> > on CLI is also questionable). This patch favors QEMU/tests vs
> > MacOS guest.
> >
> > A patch from Apple needed to change default to the valid key,
> > until then prefer QEMU maintainers sanity/cleaner test logs
> > vs any inconvenience users running MacOS guest might suffer.
> >
> > 1) After some googling, it seems 'secret' key is the same for
> > all Mac hardware and is widely known but whether it's
> > permited to use that is up to lawyers/Apple to decide.
> >
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> > hw/misc/applesmc.c | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
> > index 5f9c742e50..bce27b0950 100644
> > --- a/hw/misc/applesmc.c
> > +++ b/hw/misc/applesmc.c
> > @@ -84,7 +84,7 @@ enum {
> > #define smc_debug(...) do { } while (0)
> > #endif
> >
> > -static char default_osk[64] = "This is a dummy key. Enter the real key "
> > +static char default_osk[65] = "This is a dummy key. Enter the real key "
> > "using the -osk parameter";
>
> This is a distinct bug fix from the problem described. We should
> take this as a standalone fix no matter what.
thought about it (until I started to write commit message for that)
but it becomes bug only if default_osk is treated as NULL terminated
string, which happens only if following hunk is applied.
Without that, it's treated as 64 bytes. (we can null-terminate it
anyways just to be on a safe side)
> > struct AppleSMCData {
> > @@ -335,10 +335,12 @@ static void applesmc_isa_realize(DeviceState *dev, Error **errp)
> > isa_register_ioport(&s->parent_obj, &s->io_err,
> > s->iobase + APPLESMC_ERR_PORT);
> >
> > - if (!s->osk || (strlen(s->osk) != 64)) {
> > - warn_report("Using AppleSMC with invalid key");
> > + if (!s->osk) {
> > s->osk = default_osk;
> > }
> > + if (strlen(s->osk) != 64) {
> > + warn_report("Using AppleSMC with invalid key");
> > + }
>
> This means users who invoke QEMU won't see the warning any more. This
> feels like a dubious change, as it degrades the user experiance for
> sake of tests - IMHO users takes priority over any testing.
>
> With regards,
> Daniel
prev parent reply other threads:[~2022-07-28 12:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 9:35 [PATCH for-7.1] applesmc: silence invalid key warning in case default one is used Igor Mammedov
2022-07-28 9:48 ` Daniel P. Berrangé
2022-07-28 10:05 ` Peter Maydell
2022-07-28 10:23 ` Daniel P. Berrangé
2022-07-28 10:52 ` Peter Maydell
2022-07-28 13:29 ` Markus Armbruster
2022-07-28 13:39 ` Igor Mammedov
2022-07-28 13:40 ` Peter Maydell
2022-07-28 13:42 ` Daniel P. Berrangé
2022-07-28 14:51 ` Markus Armbruster
2022-07-28 12:00 ` Igor Mammedov
2022-07-28 12:59 ` Daniel P. Berrangé
2022-07-28 12:08 ` Igor Mammedov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728140806.7e85b183@redhat.com \
--to=imammedo@redhat.com \
--cc=agraf@suse.de \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=t0rr3sp3dr0@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.