Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1195945pxb; Sat, 9 Jan 2021 10:46:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXjEs4QnQ7x8G+VwyStExu2wm+88Qq0PdNk9seBnOJY/Zy/OXZ9K2Q49eOaUHAd8JlxLex X-Received: by 2002:a17:906:ae14:: with SMTP id le20mr6409414ejb.451.1610217968473; Sat, 09 Jan 2021 10:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610217968; cv=none; d=google.com; s=arc-20160816; b=B+qBMGXNCGbLkL78GDnp8oqrhu0xYkrA4ULZPQBDgzpx0tUt4puBrFFOuYnAbvmkyT DeP/NpbDa336kUZv6Qn/h4eDOD5aFx1L1kId6v8QULbYkpuNs8lk7rTTPD2S+GiR1utb tggZmdnh37YUqtsCCfCF0v/YBqbj32FV9MNCmTAVaeSl8PlbtsdUxco3XdvcPW/5suvl HOVxrxARR7mwhTFtEFb1HaL/v7QVtfdmqt8N882BWmMdYo4OnokFNA9K/a510gLr5qRX KIxUBcY5RVxDgJgifK8RqivV7ZUOjBFn7bCVl3oeBojscrD/ahkZFo0n2SITG07Lncqo XzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jF6VdGJxWmDWa7dHF17UAded0tYZ8eT3kZWL5vZ7tGs=; b=t9CWzXIdexBHYMossyCZgx0l5XI0T2ECACZ6wme/EPkrRo/YjvJGR2UGj+mNXQGvOs fMexPtSqiyTKvFk9D7oNX5YAvaNu2fqoEtcvxwmCTvNQpSzWRC8+MEp4MVZcRJ/5IJo+ in7KoKHNxx9So/mvCyXLP6VTEUneuY0ox7PyGQpxUZINx7Ng9hLH/GE/jLBBdnEeLBLF bE/pmtv/ys2P0OHI/mQdADJjHJMXMQKFXwoY2EvTe9/6wOvjfBqZqQhYDKyWgO8FAHrU wGxGGozKSrfdI0mJmNbeKEWkyFTv1asuXeD4qgoDzPIgEWniJw6nGMd1h52+eh9YM1hb krow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f9Kcpo3H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si4856574ejt.596.2021.01.09.10.45.43; Sat, 09 Jan 2021 10:46:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f9Kcpo3H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726249AbhAISoU (ORCPT + 99 others); Sat, 9 Jan 2021 13:44:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbhAISoT (ORCPT ); Sat, 9 Jan 2021 13:44:19 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FA54C061786; Sat, 9 Jan 2021 10:43:39 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id i7so9815136pgc.8; Sat, 09 Jan 2021 10:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jF6VdGJxWmDWa7dHF17UAded0tYZ8eT3kZWL5vZ7tGs=; b=f9Kcpo3HDTN1/Pmd/iQ0bHpjbaBiEsgUKQMFxDnQHM8BpXb143UIvPiDdHahWtgLZ3 MaGJtrFl8MAyt5+zqGdxjCviLEMDs4EsHOgtcfZBQAuCxj74NNOcikRaI7ayP36Yt214 RHyY+utuv0KD89drRbms4fPc4KyiLz9oCRX90bbYrzx8zAyikheLVDrxyZ+j6vaR6VtN cK0SpD87FAVayVxPYCxMF/UyKlAIpBSkGkauCo/Vw7ZE9ZGYjGrpzdamE18yGgCH70Kd /1weQTbUlobIEnr9rM0Wo30mECZeEa11/ZYIPe4igMIh175Jy1f6kL0dl/U0aVuJK2S2 GcuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jF6VdGJxWmDWa7dHF17UAded0tYZ8eT3kZWL5vZ7tGs=; b=l3ctj4bxF5/nOh3rPzZrvj0L2n1f46KkoxJtdVnG7Rmrk5IC7ANWAyzFSX3gTv0cEo Ua0WI4fgQU4ATy5Me60TeOG4dqU2bIieIbPtcQJZZ0o/J2KSoH/fcZq49EnI4MAc38U2 WBNMl+pNtF7IaBmRRTNYK2YRqjrFkYHFonQPxrYVNhcv/ZZawqiaaC6dUNlFADRybm9Z Y3Ce1EcfUOVw6IJZQTGEYfUnvO7tufI7mlcCzPLP8rGcfCxS4An5xfdLcyevmnPuNMwt YBbxt/4fISZ5wh1b6SZUV3vV7+MxHWsfs8TLNtjnMPhjwFEyylX61w5oWLzH0Gbq2wdn SKZw== X-Gm-Message-State: AOAM532Rrg/5MnOfBbXgVgy2vF0lpi3gfTThrKh7PAGm+odW9E9+S5iE 8CqXYXll+KXh6kmdVbDb9207wEgvIPmqgtn5lOw= X-Received: by 2002:a63:4b16:: with SMTP id y22mr12576677pga.203.1610217818960; Sat, 09 Jan 2021 10:43:38 -0800 (PST) MIME-Version: 1.0 References: <20210108072348.34091-1-decui@microsoft.com> <5464224.fTvfEN5hHQ@kreacher> In-Reply-To: <5464224.fTvfEN5hHQ@kreacher> From: Andy Shevchenko Date: Sat, 9 Jan 2021 20:43:22 +0200 Message-ID: Subject: Re: [PATCH] ACPI: scan: Fix a Hyper-V Linux VM panic caused by buffer overflow To: "Rafael J. Wysocki" Cc: Dexuan Cui , "rafael@kernel.org" , "linux-acpi@vger.kernel.org" , "len.brown@intel.com" , Michael Kelley , "rui.zhang@intel.com" , "linux-kernel@vger.kernel.org" , "wei.liu@kernel.org" , Stephen Hemminger , Haiyang Zhang , KY Srinivasan , "dwaipayanray1@gmail.com" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 9, 2021 at 7:08 PM Rafael J. Wysocki wrote: > On Saturday, January 9, 2021 10:37:41 AM CET Dexuan Cui wrote: ... > > Do you want a simple strlen() check like the below, or a full > > check of the AAA#### or NNNN#### format? > > It would be good to check the format too while at it. Let me summarize. It seems from my perspective that the best is to have two checks here (as far as I got word "too" in Rafael's reply): - per length with a message that "length is exceeded" - per format with probably different messages depending on the checks (like "vendor prefix has incorrect format" and "device id has incorrect format"). -- With Best Regards, Andy Shevchenko