Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5533807rdb; Wed, 13 Dec 2023 11:18:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTByDhNnEvN3jXM2XLH++pSQX+kfLLjRbxXhZJVb2mXFI3Tz4yilYF+9uo4JID+OpRpz7M X-Received: by 2002:a05:6a20:1388:b0:187:5db4:1688 with SMTP id hn8-20020a056a20138800b001875db41688mr8600269pzc.18.1702495110600; Wed, 13 Dec 2023 11:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702495110; cv=none; d=google.com; s=arc-20160816; b=bvpw3aP4YPUA9JQpq+qxoe+z1PuFsrRtuBqKEBQpCMVGyZdrGZwzjLqsAGPzyBHtuK cF6/GRSyPfeYsd1SV8N0FOdG+H6JNS4nbGUxGZlN5Iouzz3kY/Ys3i/COFB2LvBQzHq9 se4izxfAuKZC0LIxznb6POZjS2NZF8Yeimb9617c5t6us+ilMfQO6lt9DARGER2Fs6FM 2Nm8xZU1lfnxEwpwColovaMkbnVPkqmhQpGHPrK5+F3md+SxIDggtoaXNyx7umvbJ8by 0IyLHhOpv3xjwQ92E0nkchs63XlkToTakGqxU1A0GMjkAcfsu+P05hjfrgIVQNzPbdO+ cCug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P4zCTjl8Zj5OEvodPkRWE7USQTKPwsDssLjsj8FI8bA=; fh=oZVAHlMpLOTU6S62UZl8/TauhNLaxduUePTPyydcAAw=; b=yFoGtnIdgC0E+Yy37MZICzZ813OBnNt18YH0eZahyxbr6n4QHhi3cbYK18m4b6hEDx STTY8VFRkMewKO+wzULdRKsP8d/g+rEmEFUXGiRDZ9ywA160vJiu7e9rFM+xK3vmLDRO TgPcicpKP2Ka/kDMOJv/WszWhdR5CNTQuixOorSayemx5gTgBvLc3ET7LP02F669GsmB s3W3S1wgRwtAMKtAy9maGs2nY8hcLsIcotUuzE2veYSSGgpdTFDeAasR/3LJ1WThmkun l3CqjNjT9bL2hQBEdQIGnmblimp8owpK3WS+FHrjeVR1ovbPNzJgXr1mBudZb+QjIBHu aA0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lZz9CcOG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f7-20020a6547c7000000b005c5fdbbaadbsi10105714pgs.588.2023.12.13.11.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:18:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lZz9CcOG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0911F80BD3A4; Wed, 13 Dec 2023 11:18:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442035AbjLMTSO (ORCPT + 99 others); Wed, 13 Dec 2023 14:18:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233516AbjLMTSN (ORCPT ); Wed, 13 Dec 2023 14:18:13 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECADA3 for ; Wed, 13 Dec 2023 11:18:20 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d098b87eeeso65079655ad.0 for ; Wed, 13 Dec 2023 11:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1702495099; x=1703099899; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=P4zCTjl8Zj5OEvodPkRWE7USQTKPwsDssLjsj8FI8bA=; b=lZz9CcOGQ28jt/M2KoCb8vMde8vGPhufwRb8bQuaSl436TZ9tXXsG9DAgyUwShg/Bn DSaROe7fmupWCKjwUTHAIa18mivqYHDb0JmqCq6i7MOQoDLZW6UGsJi3Tmd+eZotmUJE qlYgX3eIPGAIXsTXSS4MSFAkakwlxjQlqLRPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702495099; x=1703099899; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=P4zCTjl8Zj5OEvodPkRWE7USQTKPwsDssLjsj8FI8bA=; b=m2KXvAIyFlrCk3QFgvsrIbx7RBqhAtYEZlHMyfV6Sf5b5Msl5j2QWXtnaOvM5KVPIC RWOgKNJVS3N7cPcQ8OglLyo1Dyl4RlTmUuJFjkYdWDDF6WiZLhyYb/iWMkfNGwoO8CL8 nXdOKQiXEJ48UiziwdWvWqQ1l2r5gkgTE7n83elD8Q1fMaqWp+0oP/nyRg7xugAr6iAm OILK4u+wXJRdi+NpclF1S+fWIv72OaDaSojPkhbQVxCXq7dj8DXKod5F+JKpLcbFjSz+ g76W1JSinuq4vCDl2gcqqOqrfCElK0i5N2QotDTexxq7S4DsUacZfmnK1xMtqOea7xRm y41Q== X-Gm-Message-State: AOJu0YwgWRqCJNPUqD+xqy+7geCC9mpsKyY8H6MYM+XmLe9FSORxC/Vy mdpMzllQRSXFY9mHJUBFi7agoQ== X-Received: by 2002:a17:902:e74e:b0:1cf:9c44:62e with SMTP id p14-20020a170902e74e00b001cf9c44062emr9894221plf.34.1702495099627; Wed, 13 Dec 2023 11:18:19 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id a8-20020a170902b58800b001d05bb77b43sm10882454pls.19.2023.12.13.11.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:18:19 -0800 (PST) Date: Wed, 13 Dec 2023 11:18:18 -0800 From: Kees Cook To: Anders Larsen Cc: Ronald Monthero , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 0/2] qnx4: Avoid confusing compiler about buffer lengths Message-ID: <202312131118.F350E56D@keescook> References: <20231130205010.it.412-kees@kernel.org> <170241597608.164694.1762861756800879766.b4-ty@chromium.org> <12341921.O9o76ZdvQC@oscar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12341921.O9o76ZdvQC@oscar> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:18:28 -0800 (PST) On Wed, Dec 13, 2023 at 05:43:08PM +0100, Anders Larsen wrote: > Hi Kees, > > On 2023-12-12 22:19 Kees Cook wrote: > > On Thu, 30 Nov 2023 12:51:17 -0800, Kees Cook wrote: > > > This attempts to fix the issue Ronald Monthero found[1]. Avoids using a > > > too-short struct buffer when reading the string, by using the existing > > > struct union. > > > > > > -Kees > > > > > > [1] > > > https://lore.kernel.org/lkml/20231112095353.579855-1-debug.penguin32@gmai > > > l.com/ > > > > > > [...] > > > > I'll put these in -next since there's been no more discussion on it. > > > > Applied to for-next/hardening, thanks! > > thanks for taking care of this (and apologies for me being unresponsive) > > If it's not too late, feel free to add > Acked-by: Anders Larsen Thanks! I'll update the tags. :) -- Kees Cook