Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYX6y-00GRu9-Uq for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2024 20:04:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rYX6x-00C1uN-PB for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2024 20:04:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYX6x-00C1uF-G1 for pgsql-hackers@lists.postgresql.org; Fri, 09 Feb 2024 20:04:35 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rYX6v-005wLb-1W for pgsql-hackers@lists.postgresql.org; Fri, 09 Feb 2024 20:04:34 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7bff28b2937so49594939f.1 for ; Fri, 09 Feb 2024 12:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707509072; x=1708113872; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=DwIaen1j2D/7VZwFUp9RuFggCQM4W75cSownuh8ulY0=; b=X7vxFi2YBarZKBsNcJgjj6FgiuL4qCQEe2e50lMqJcO+d/WCkv8cw0Syl+TvYkaAIz kipc0AVaQKPNvRoJiFoJWOXUSK1uLuJSZjXv9NOHS6DOi5Oj21c8EX+hIJ/oB9d0YdPY XoPQfuzypnJC92Er14QXDZnvp9pgt+b61J5reL4DwBFr4gq/KRmlhyMKzvqYA2bn6gGs UJ0MyR+skZ+by2ZZGF1mxCiR8FWXLb9QTPD/d0Lg1yXdLOnJMNCnMkicZR+Ut9yw35Hk 4MpVi+/zg1KN3m9bkw9JrXk9pFtKfz5jIqmP6aO/4ccrUJDEiMhP6Ce4vQ1irz14d4T6 5qGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707509072; x=1708113872; h=in-reply-to:content-transfer-encoding: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=DwIaen1j2D/7VZwFUp9RuFggCQM4W75cSownuh8ulY0=; b=MoJ8lAmcv9gXk3iZJO8zvBOxmGKkF890IsR/yGOLT22zjPALmID9aC8NIPhoSG049b XxMUedQndBS/b7N2TG9ma8XWbzOTDIF6sM2S8W+rr6DzpZDk8LCbofuX4O3ElxXhjM8b YinBGYOmQCsxDMl8RIEKw8oESFifv6j7uikK1CgnmU9/jOnTaf20RpcBgZceoJ1NSAT8 /4Hplsjnsa9gUT8Br/ls8kja2ZDhDzQ0hs/N+qyv3CCltRICr+AdSVhBN+thx4HgG0z1 KzhidKE4oPM+c37lhdVnEZgFaRPabEvzVl7crMGQ5byJhnmCjF4zZBDk5YLXi/h4uHux EKhg== X-Forwarded-Encrypted: i=1; AJvYcCX5mp2R0awfWINaFU7y60VU9r+T4tnhCSThbkm7tqIH2qmllhuQr2YhpIjwJ7XJ7xZvIpLt4odXGelcSphuxvT+CSa6tcVskKs2x86XaQswxMrG X-Gm-Message-State: AOJu0YwickJhavvDhTkaL/TY/VFOZViN9z67jbL3XDTX7IbVp+tRakRZ aW+lHVEDIDR+0ztFms2CdPNfTq71qW/D/b6nPijGHzANP2qPoogD X-Google-Smtp-Source: AGHT+IHNNtzFSZTn9DzDS7Xa34T9tmcZOUoERgo9rRKx9SdxedAd3OAY63RO+H7KbKmfDLhMYdoTCw== X-Received: by 2002:a6b:5f17:0:b0:7c3:f2f8:384e with SMTP id t23-20020a6b5f17000000b007c3f2f8384emr472207iob.7.1707509072204; Fri, 09 Feb 2024 12:04:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXlHt8zDrHo8CFknL9pDf2Xr8pXh1cWbjZtb78BtRpHSWj77Qo16dRID4Co0GS33vJibWuXgZCzF/T+snMzCCkJKH7oFq8NQ6bISrgrAv6RmO6wTE23fimG4jKbcR+ecNoqBKXAs26+5DHxIbj1AXyUUpFu+44HAmJ2oGCFcutRcqylUcTGMSACCycrSOLGnw== Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id x17-20020a056638161100b004736ac68049sm31897jas.108.2024.02.09.12.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 12:04:31 -0800 (PST) Date: Fri, 9 Feb 2024 14:04:29 -0600 From: Nathan Bossart To: Mats Kindahl Cc: Tom Lane , Andres Freund , Thomas Munro , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: glibc qsort() vulnerability Message-ID: <20240209200429.GA665650@nathanxps13> References: <20240208183835.GA503311@nathanxps13> <1074897.1707417842@sss.pgh.pa.us> <20240208195954.vlpoii4ftoow2of4@awork3.anarazel.de> <20240208200737.GA504276@nathanxps13> <1242426.1707424769@sss.pgh.pa.us> <20240209162433.GA663211@nathanxps13> <1596756.1707496048@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 09, 2024 at 08:40:47PM +0100, Mats Kindahl wrote: > On Fri, Feb 9, 2024 at 5:27 PM Tom Lane wrote: >> We do pretty much assume that "int" is "int32". But I agree that >> assuming anything about the width of size_t is bad. I think we need >> a separate pg_cmp_size() or pg_cmp_size_t(). > > Do we want to have something similar for "int" as well? It seems to be > quite common and even though it usually is an int32, it does not have to be. I don't think we need separate functions for int and int32. As Tom noted, we assume they are the same. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com