mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Lv Zheng <lv.zheng@intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>, Lv Zheng <zetalog@gmail.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Bob Moore <robert.moore@intel.com>
Subject: Re: [PATCH] ACPICA: ACPI 5.1: Add support for runtime validation of _DSD package.
Date: Tue, 02 Sep 2014 23:52:27 +0200	[thread overview]
Message-ID: <1928853.GNCaIt2FMa@vostro.rjw.lan> (raw)
In-Reply-To: <856f29de2607cab36bb3936fae26daa275e0b129.1409275857.git.lv.zheng@intel.com>

On Friday, August 29, 2014 09:32:42 AM Lv Zheng wrote:
> From: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Adds ACPICA kernel runtime support to validate contents/format
> of the _DSD package, similar to the iASL support. Ported by
> Mika Westerberg.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>

Queued up for 3.17-rc4, thanks!

> ---
>  drivers/acpi/acpica/nsprepkg.c |   39 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
> index 68f7258..1b13b92 100644
> --- a/drivers/acpi/acpica/nsprepkg.c
> +++ b/drivers/acpi/acpica/nsprepkg.c
> @@ -316,6 +316,45 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
>  		    acpi_ns_check_package_list(info, package, elements, count);
>  		break;
>  
> +	case ACPI_PTYPE2_UUID_PAIR:
> +
> +		/* The package must contain pairs of (UUID + type) */
> +
> +		if (count & 1) {
> +			expected_count = count + 1;
> +			goto package_too_small;
> +		}
> +
> +		while (count > 0) {
> +			status = acpi_ns_check_object_type(info, elements,
> +							   package->ret_info.
> +							   object_type1, 0);
> +			if (ACPI_FAILURE(status)) {
> +				return (status);
> +			}
> +
> +			/* Validate length of the UUID buffer */
> +
> +			if ((*elements)->buffer.length != 16) {
> +				ACPI_WARN_PREDEFINED((AE_INFO,
> +						      info->full_pathname,
> +						      info->node_flags,
> +						      "Invalid length for UUID Buffer"));
> +				return (AE_AML_OPERAND_VALUE);
> +			}
> +
> +			status = acpi_ns_check_object_type(info, elements + 1,
> +							   package->ret_info.
> +							   object_type2, 0);
> +			if (ACPI_FAILURE(status)) {
> +				return (status);
> +			}
> +
> +			elements += 2;
> +			count -= 2;
> +		}
> +		break;
> +
>  	default:
>  
>  		/* Should not get here if predefined info table is correct */
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2014-09-02 21:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  1:32 Lv Zheng
2014-09-02 21:52 ` Rafael J. Wysocki [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=1928853.GNCaIt2FMa@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    --cc=zetalog@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 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®