From: Nikita Kiryushin <kiryushin@ancud.ru>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>, Bob Moore <robert.moore@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH] ACPI: OSL: Initialize output value
Date: Tue, 5 Mar 2024 14:25:52 +0300 [thread overview]
Message-ID: <17bad2c5-e401-45cc-8351-cc28e461257c@ancud.ru> (raw)
In-Reply-To: <CAJZ5v0hxkoeFYVxQ_ZYCMK+0L=7WdBQHRp6ouv+FzahfMrs_eQ@mail.gmail.com>
On 11/21/23 23:05, Rafael J. Wysocki wrote:
> So wouldn't it be better to avoid modifying *value at all if
> raw_pci_read() returns an error?
Avoiding of modification of *value at all seems better idea to me than
setting it to arbitrary initializing value, indeed.
In that case, buffer initialization can be ditched, and *value set only
in case of success.
> And if it returns a success, why wouldn't it be trusted?
>
My concern is, that raw_pci_read() wraps platform-specific handlers,
that should conform to the next rules:
1) in case of success, they must set value32 (or else, uninitialized
data would leak to acpi_os_read_pci_configuration caller);
2) they should use passed &value32 only to set it (or else,
uninitialized data would be used/passed somewhere, is it safe?);
Is there any way to be sure, that all the existing and future
platform-specific pci-read handlers conform?
prev parent reply other threads:[~2024-03-05 11:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 19:45 Nikita Kiryushin
2023-11-21 20:05 ` Rafael J. Wysocki
2024-03-05 11:25 ` Nikita Kiryushin [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=17bad2c5-e401-45cc-8351-cc28e461257c@ancud.ru \
--to=kiryushin@ancud.ru \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®