All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Muhammad Bilal <meatuni001@gmail.com>
Cc: platform-driver-x86@vger.kernel.org, jorge.lopez2@hp.com,
	 Hans de Goede <hansg@kernel.org>,
	linux@weissschuh.net,  LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 11/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in string-attributes
Date: Wed, 12 Aug 2026 13:41:26 +0300 (EEST)	[thread overview]
Message-ID: <f337b075-fbb4-db20-8a94-b58b254fd864@linux.intel.com> (raw)
In-Reply-To: <20260803143037.93105-12-meatuni001@gmail.com>

On Mon, 3 Aug 2026, Muhammad Bilal wrote:

> Same defect as the companion fix to enum-attributes.c in this series:
> the PREREQUISITES case consumes "size" consecutive ACPI package
> elements via elem + reqs, but the outer loop only advances "elem" by
> one per iteration, causing the next iteration to misread a leftover
> prerequisite entry as the next property and abort the parse with
> -EIO on the resulting type mismatch.
> 
> Fix by advancing "elem" by (size - 1) after the loop.
> 
> Fixes: e6c7b3e15559 ("platform/x86: hp-bioscfg: string-attributes")
> Cc: stable@vger.kernel.org
> Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
> ---
>  drivers/platform/x86/hp/hp-bioscfg/string-attributes.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c
> index fe5a9a3a4ef1..5abec8995911 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/string-attributes.c
> @@ -233,6 +233,8 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob
>  				kfree(str_value);
>  				str_value = NULL;
>  			}
> +			if (size)
> +				elem += size - 1;
>  			break;
>  
>  		case SECURITY_LEVEL:
> 

Hi,

First of all, thanks for working with this driver.

There's no need to do the same fix in n patches. If the problem is the 
same in multiple files, they can be in the same patch. You just need to 
generalize your shortlog prefix a bit when combining.

I'll probably take this series once that is fixed (and after I do a 
deeper review on them changes) ...

... BUT,

This entire driver was merged half-baked, with outstanding comments from 
me unaddressed. One of the most important unaddressed comment related to 
the massive use of copy-pasted code which leads to having the same bug in 
multiple places.

Once this series is done, could you try to look into consolidating similar 
parts in these attribute type files so that there would be a common 
function that is called by each of these attribute type files (and if a 
common function is not possible due to types, perhaps macro could be tried 
instead)? I'd be very welcoming for such a cleanup to finally start 
cleaning up the mess this driver is.

If you extract e.g. hp_populate_integer_elements_from_package() and 
hp_populate_string_elements_from_package() and diff those two functions, 
you'll see what I mean. A struct is even called "common" in the struct
string/integer_data so I expect it could be parsed by a common function.

-- 
 i.


  reply	other threads:[~2026-08-12 10:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 14:30 [PATCH 00/13] platform/x86: hp-bioscfg: fix multiple memory safety bugs and parsing errors Muhammad Bilal
2026-08-03 14:30 ` [PATCH 01/13] platform/x86: hp-bioscfg: fix off-by-one write in hp_get_string_from_buffer Muhammad Bilal
2026-08-03 14:30 ` [PATCH 02/13] platform/x86: hp-bioscfg: fix heap OOB read in sk_store and kek_store Muhammad Bilal
2026-08-03 14:30 ` [PATCH 03/13] platform/x86: hp-bioscfg: fix heap OOB read on empty password write Muhammad Bilal
2026-08-03 14:30 ` [PATCH 04/13] platform/x86: hp-bioscfg: fix 16-byte heap overflow for empty auth token Muhammad Bilal
2026-08-03 14:30 ` [PATCH 05/13] platform/x86: hp-bioscfg: fix off-by-one heap OOB write in audit_log_entries_show Muhammad Bilal
2026-08-03 14:30 ` [PATCH 06/13] platform/x86: hp-bioscfg: add missing bounds check in PSWD_ENCODINGS loop Muhammad Bilal
2026-08-03 14:30 ` [PATCH 07/13] platform/x86: hp-bioscfg: fix new_password_store overwriting current_password Muhammad Bilal
2026-08-03 14:30 ` [PATCH 08/13] platform/x86: hp-bioscfg: fix ORD_LIST_ELEMENTS never being parsed Muhammad Bilal
2026-08-03 14:30 ` [PATCH 09/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in enum-attributes Muhammad Bilal
2026-08-03 14:30 ` [PATCH 10/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in int-attributes Muhammad Bilal
2026-08-03 14:30 ` [PATCH 11/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in string-attributes Muhammad Bilal
2026-08-12 10:41   ` Ilpo Järvinen [this message]
2026-08-12 11:21     ` Muhammad Bilal
2026-08-03 14:30 ` [PATCH 12/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in order-list-attributes Muhammad Bilal
2026-08-03 14:30 ` [PATCH 13/13] platform/x86: hp-bioscfg: advance elem past consumed array elements in passwdobj-attributes Muhammad Bilal

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=f337b075-fbb4-db20-8a94-b58b254fd864@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hansg@kernel.org \
    --cc=jorge.lopez2@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=meatuni001@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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.