From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2d.google.com (mail-vk1-xa2d.google.com [IPv6:2607:f8b0:4864:20::a2d]) by sourceware.org (Postfix) with ESMTPS id 294CA3858C74 for ; Thu, 29 Sep 2022 13:25:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 294CA3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-vk1-xa2d.google.com with SMTP id y129so655116vkg.8 for ; Thu, 29 Sep 2022 06:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=R2vPvPKYAcFdkQme2iGAPComNQBVFPuRr0CqRAEpnY0=; b=m3ZhebtU1oTXV+ijsfnyIIsT8ZRiKM9RBGt3QwgYt4NnOyI68I19rK9K8p0f5T3KzM MUDBb1aadurA07L4FxdHjN3uIwPkAo5xj7IJQ4KjZfvO5WC1qtaloqQ3iopW3DwHt5s4 edkuba7K96TsbJxVRX51jQ+tHQYraxUbaUNuRq3rvX1JTvqIx045hAvq+WoXwz5nAoGY AAS1w1F/SYOLNzA2W4lNyHjDd8EEvjzKmwsp4nDNGApDDZIzLvKWdhtJsMjt8C59Fodo Jo6JOiOrqaH852dR3Y1IMszyJJziQxQ68UwpYalPvpI+be0p9/NgOusHk86nN5w1UPfo BgWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=R2vPvPKYAcFdkQme2iGAPComNQBVFPuRr0CqRAEpnY0=; b=SVGvRZlIZiEQYP0/kU0Q13sNc0z7R1YjmyKmsHMzIAgjErNozPBHM9t8w2vFUi9KDY GFYGQBwHnwUzkgXnX9nr5eDxgjWWBEwm4CJ4BBbD1m3eLG1zBFH6CCRfvjxrnnaLa7sW thH32IqDz5LzsevKT/F9cIDfH2WOBysO5C7UQaKHik2cMe8eCiJDnFPsP08CZPWeZSKo JolbRiYW6kYRH/9YFYsCK/fDo0e05w7QQdvZJaNELluUI0aQCgvy1HSBW8KRjzm0YY0i WkbG45pt7SgaJxjHLaD7ri/foGX7oZpAIVkTTrw7IUoPVdkBkXkNzmcX/EdGazcN0VxR IIuQ== X-Gm-Message-State: ACrzQf3hcd8ChKr7Tin7RrX5muQqSxpIPNRvrvM2TmAhO0e9t2WDrEB7 roMOYaiZaBPShJjoEQD9x6fRIHfUHuMYbOAR X-Google-Smtp-Source: AMsMyM6Z3ShfSPbyuLqDzTm2kaeUJeRJ2Nf1rlfTc7s5NJN6fBuXEslVr4UoAqHoo3uVv6OkB0ey1g== X-Received: by 2002:a1f:2e8e:0:b0:3a3:bc29:8e93 with SMTP id u136-20020a1f2e8e000000b003a3bc298e93mr1437319vku.19.1664457942063; Thu, 29 Sep 2022 06:25:42 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:3736:1cf0:b6ef:db77:c498? ([2804:1b3:a7c2:3736:1cf0:b6ef:db77:c498]) by smtp.gmail.com with ESMTPSA id s188-20020a1f90c5000000b00394b4d546c0sm1748356vkd.33.2022.09.29.06.25.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 06:25:41 -0700 (PDT) Message-ID: <135a1020-b8b4-3502-10fa-8373d3ed67f6@linaro.org> Date: Thu, 29 Sep 2022 10:25:39 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] malloc: Fix clobbered errno when getrandom failed [BZ #29624] Content-Language: en-US To: libc-alpha@sourceware.org References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 29/09/22 09:42, Wilco Dijkstra via Libc-alpha wrote: > Hi, > > Also note the getrandom syscall is redundant since random_bits uses > clock_gettime. There is no need for a cryptographic random number here, > so the syscall can be removed. It will be a syscall on some architecture anyway (although very unlikely to fail). But I agree it make sense to use random_bits here. > > And in places where we do want to use getrandom, it makes sense to > wrap the syscall so that we avoid introducing this bug in more places. Yeah, I will send a patch to fix both issues.