Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75798C61DA4 for ; Mon, 30 Jan 2023 15:46:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237824AbjA3PqQ (ORCPT ); Mon, 30 Jan 2023 10:46:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237369AbjA3Pp6 (ORCPT ); Mon, 30 Jan 2023 10:45:58 -0500 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 930633FF0E; Mon, 30 Jan 2023 07:45:43 -0800 (PST) Received: by mail-ej1-f44.google.com with SMTP id gr7so8358857ejb.5; Mon, 30 Jan 2023 07:45:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0PvbEcYxraBBpiH7uTe+5RKHDm8u6Tluv0rEzDxAUZg=; b=rT4QkrcAAG1zo2sYK1nW8k2vCLgR5nGF9j+ke9b5nxweTOgXIAl2cR+0SJ3OxutiFn be11SqSymcjnxGxQ7IhpNrRLNLYJACo5SXku/RggiXOwuQhXvtJVo6/nM3WYeH1OwsgM Y6SfzJN6XI8+GoFTdmFLfGxERbqvBjhby6mnrgDJ6YVoldVOPOvv0CpFr/T5kaQhU5yY rYcJ7jgPR7Ru7S0IgnGxhAwGEB2N61Hm4d4NrtnWjty30LGFibhiY5/IWzRfgDv6X8u6 +cuj8in+ZSle2wKZfeSPeGmo8cICNtStp3eZb8oiurUZ4Ye1Ba1jUVxldrB9O3xeOCfT sRLg== X-Gm-Message-State: AO0yUKUUR0ZBa3VxrM3dTINdFUEeqkxLRHT6cNnuoCWe1XNSNAZbxarN yds/T9nqW8mx/qbJet5J8CzAzMxXDeI9WldYxJA= X-Google-Smtp-Source: AK7set/Ulxsu+qRUJPbaTJqX2uabotCXwgGrTXh+6Eaa/BktTHIkqHNwrMuGvW2EEEi21/g527R5TYsgKYhSzFKOiGo= X-Received: by 2002:a17:907:58d:b0:878:581b:63ee with SMTP id vw13-20020a170907058d00b00878581b63eemr3809440ejb.244.1675093542178; Mon, 30 Jan 2023 07:45:42 -0800 (PST) MIME-Version: 1.0 References: <20230119142115.38260-1-W_Armin@gmx.de> <8e3ddde5-87aa-a72a-dcfa-5a6041377b15@gmx.de> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 30 Jan 2023 16:45:30 +0100 Message-ID: Subject: Re: [PATCH v2 0/2] ACPI: battery: Fix various string handling issues To: Armin Wolf Cc: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 30, 2023 at 1:29 PM Rafael J. Wysocki wrote: > > On Mon, Jan 30, 2023 at 10:14 AM Armin Wolf wrote: > > > > Am 19.01.23 um 15:21 schrieb Armin Wolf: > > > > > On my Dell Inspiron 3505, the battery model name was displayed > > > differently than when running Windows. While i first suspected an > > > ACPI issue, it turned out that the real reason was the ACPI battery > > > driver failing to handle strings larger than 32 bytes. > > > > > > This caused the model name of the battery (35 bytes long, hex string) > > > to miss proper NUL-termination, resulting in a buffer overread later. > > > Luckily, a valid string was stored right after the now invalid string, > > > appending only the battery serial number to the original model name. > > > > > > The first patch fixes a potential buffer overread then handling buffers, > > > while the second patch finally increases the maximum string length to > > > avoid truncating such larger strings. > > > > > > The patch series was tested on a Dell Inspiron 3505 and appears > > > to work properly. > > > > Are there any outstanding issues with the patch series which need > > to be fixed for mainline inclusion? > > I'll have a look shortly and let you know. I've queued up the patches for 6.3, thanks!