From mboxrd@z Thu Jan 1 00:00:00 1970 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 6D4B7CCA48B for ; Mon, 25 Jul 2022 11:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234933AbiGYLXj (ORCPT ); Mon, 25 Jul 2022 07:23:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234784AbiGYLXh (ORCPT ); Mon, 25 Jul 2022 07:23:37 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8C2114D08; Mon, 25 Jul 2022 04:23:36 -0700 (PDT) Received: from zn.tnic (p200300ea972976f8329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9729:76f8:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1AAB41EC008F; Mon, 25 Jul 2022 13:23:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1658748211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=PHiPrUGWkb2npOiWZGq9krYN7DofBXhS5cj0KqGkGSk=; b=BlhWLzvhOlgajCM5WhLq8PNPQGAPVrWfL0yRL2tWVdKXyvXO2IYm9Kx+fjwMbh5gJRiqgh 4rZ8hcZvgDXXIjcFBdWLHOwB4slPkgxWvbLjYN0Bzbm908iyWGgE1tm8DKLa0B42WuGscJ +UPJoQJzxctexQEzfBLgDY1mQE26UmU= Date: Mon, 25 Jul 2022 13:23:26 +0200 From: Borislav Petkov To: Robert Richter , Toshi Kani Cc: mchehab@kernel.org, elliott@hpe.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] EDAC/ghes: Fix buffer overflow in ghes_edac_register() Message-ID: References: <20220721180503.896050-1-toshi.kani@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 25, 2022 at 01:09:11PM +0200, Robert Richter wrote: > I see now, what you mean here, may be change this: > > snprintf(dimm->label, sizeof(dimm->label), "%s %s", > (bank && *bank) ? bank : "N/A", > (device && *device) ? device : "N/A"); > > to: > > snprintf(dimm->label, sizeof(dimm->label), "%s%s%s", > (bank && *bank) ? bank : "", > (bank && device) ? " " : "", > (device && *device) ? device : ""); > > It keeps the default assignment from edac_mc_alloc_dimms() but changes > we label if one of bank or device is given. Yap, that should take care of all possible "configurations" BIOS throws at us. Toshi, could you pls add this to the fix and test it on your machine to make sure it still works as expected? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette