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 1rZxF8-007M5b-B5 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Feb 2024 18:10:54 +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 1rZxF6-001ae0-Q8 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Feb 2024 18:10:52 +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 1rZxF6-001adf-GY for pgsql-hackers@lists.postgresql.org; Tue, 13 Feb 2024 18:10:52 +0000 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rZxF4-006Zzh-0M for pgsql-hackers@lists.postgresql.org; Tue, 13 Feb 2024 18:10:51 +0000 Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7bfd527d443so132766739f.3 for ; Tue, 13 Feb 2024 10:10:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707847849; x=1708452649; darn=lists.postgresql.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=0cxHKcm1tpkqi9MxBQhYhIsGzjYa2TlGCxdjNwoBa/8=; b=kb3Rj+0DWmTamnGk10zE6/gbBzqJftpXYTu3xp14pjq0OHcQpHcVxYfa1CM9oWOHyw BPZCGYUupBTl8M2mdSxUwOqi9marDWVI7fV0rA3TD6731+1nLiA8fPWzs3pI7/KEkq0O yTpvxAHU6wieGEkVzhXbr5UCo8glihJNXqyfvZ4CxpGoaLSYI8ReSx/63w3ZvPK+PAY1 tu3dbiCfBMmeQTF7QefwHZ+EHoRZBIcj1Pr5NQDIdHv3HerVmHGNAVVvvfII6rixEizM +8pwcW+bT9EOCZ/kzK6rXq106m1S5oYcrrYRMFX/QxQDJEeOP2QYYKqFVeya1TcLrPnS u3DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707847849; x=1708452649; 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=0cxHKcm1tpkqi9MxBQhYhIsGzjYa2TlGCxdjNwoBa/8=; b=d6Dg3GAsnJc+FU8CIV5HmwZizzJ9majzmirzXNi390kFxFA+KZYOy2w1cb6YjwZEOa ffn39hhyMmSfdKkSjW3DKKoZpMA+vi3edDM/+4twjksxjoBa65jYJhIOnWG+Vy0/YkKo TKE0cHViN03Vo0EglVErRLA1YzQkqniUfXOQBf45hqOGYmSYKUG2RnWNBcMgQV8MNs1w BkTAvVYXfvInDhPDuA9co7rFMDguBmkhWR9J4YwY0BLsHLbE+Izbq+b0GM4bqzAd7xH4 SruURS8qCP6RrsFBPt24hCyV6Jcv1Hixvr9myjYPCATkT3yK21lN6h34eTqK5fmiAMSZ j2Fw== X-Forwarded-Encrypted: i=1; AJvYcCXywhK3TlLo/aGTseKjNyNjQ3Q4mC3F+JWjXJ5Yeae3pZcGIF63PizvSvm6CkuroqCyKI2AVYDFgrYgihNTDATU9ruAe0dSErClktvHDHCq5DoR X-Gm-Message-State: AOJu0Yy1I2kof9tKfJPS1D2Frk2uLySiXgPW+4AbuJrStF50vRSSFBOQ LZqHYLl1rkI0ijHvRPDFNXh3cq64r4cho3DpriJTG03MuWnZE+Wr X-Google-Smtp-Source: AGHT+IHc7mXr8BNgATrTkazu4O3KSWCLNoGC1FXsiyfIqHwQR884TWDyVPa6mJtWqFi9BqStjj0DPQ== X-Received: by 2002:a5d:8185:0:b0:7c4:65c1:c442 with SMTP id u5-20020a5d8185000000b007c465c1c442mr574578ion.11.1707847849107; Tue, 13 Feb 2024 10:10:49 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV7lh8pn77e73xH7mi0r1UbgWgn2Mps2HgGn67wfPdXcZ3cNntQQGIBXE2k9LK1YykycbgUgN1bEw+llwe7i56PHjuOikXWucA74/UL9YQXaTx9aVX/sS4ug/rip/r4hsUrh6rA1V4VLEfTcp5IMLWvp3EhA+kEkJTum4jEeh1+2XyaMw4Q0WNOeFfumrPc Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id w20-20020a056638139400b00471495fa313sm1948481jad.150.2024.02.13.10.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:10:48 -0800 (PST) Date: Tue, 13 Feb 2024 12:10:44 -0600 From: Nathan Bossart To: Mats Kindahl Cc: Andres Freund , Tom Lane , Thomas Munro , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: glibc qsort() vulnerability Message-ID: <20240213181044.GA13935@nathanxps13> References: <20240210205332.GA1124797@nathanxps13> <20240212155715.GB1645880@nathanxps13> <20240212205138.GA1815383@nathanxps13> <20240212213130.jp5vwotwazypaaez@awork3.anarazel.de> <20240212230423.GA3519@nathanxps13> <20240212234134.ilwrxvwyza3vvps7@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Feb 13, 2024 at 09:43:18AM +0100, Mats Kindahl wrote: > Maybe we should change to use the original version equivalent to the inline > function above since that works better with surrounding code? I don't think that's necessary. We just need to be cognizant of it when using inlined sorts, which are pretty rare at the moment. Your patches should still be a net improvement in many cases because most qsorts use a function pointer to the comparator. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com