From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) by sourceware.org (Postfix) with ESMTPS id DCA053858D1E for ; Fri, 30 Sep 2022 16:37:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DCA053858D1E 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-xa32.google.com with SMTP id y129so2529035vkg.8 for ; Fri, 30 Sep 2022 09:37:21 -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=Hj/rt1eZMf6hiM73qJnEMo0wFaL/SBjr9t+J90CaPNY=; b=gD5fCDAERjNginYXU7TpYeTT/rtYhWzP2s71Mz7QU4J1IXwKDLT+ejgTEOHioGR2aG VBzQfrqBqD883ev/VYjMo7xonkqgIkGCNqKivkA6OEQTQBvZ6U9AFqCJkSK66XxuC4/X CsSqp3SfdNf/EmCrHNIe9Ev4yS58GvF7mFcgG1gZbgAkUVJC54L+DFG0GbWk6/o9DpNt 6d3ahVRrimLD5P2V2k3Wy220j7QVhhgW0IstKitz14tXfGVkliiLVQAqD80n11Rym80c Huu3vk1WIGyQsQe5XO6pgVDr46qx4NMGxN9mS27fPq5aVaybZTTcZOaO/N8C9+csDkIK XnGA== 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=Hj/rt1eZMf6hiM73qJnEMo0wFaL/SBjr9t+J90CaPNY=; b=UjhQmZNJet614Hix+LQxFGzAb3NTxCktgQb5nDkOR3Uq8Vu12Dy2sJYiyWQfxZ5Dim OpeVkjbcqHGMZ/NyR2FRJ4E9kkNm0ZkBj0p1BAuDrKfEktugbdexMlSa4VqZl1KsydUB w22vhJSHY6LJHfe+fli3/gTDx4XQ84JGUpYQSM5GAF+N9RcLlX6Bwd6vOesV7Lkc00Zy gCdfLK+ljnwKQYoeW8HUJR3BB1xbemL5P/25dG0CBV5f4+hAhPcrhk01zysLsl+PZyLs VemxAxpQ5tCA0ya3aUjRD0Qn20jzP2Xz0qF0bF7xSW3UTJ1pyZJYb2wMzIfdKM4mJI9L baQg== X-Gm-Message-State: ACrzQf3agzSrRqwN3cy2V1VrnVY6veZWwAHpWE2hgG0F27qVGgT0iKK/ esacHv/WWaytn9r4x0SRwfWcOLroPyCZdIUe X-Google-Smtp-Source: AMsMyM4gWgakkApdp2axBqbZvAntjTWyw0Mg9frsSeBJyEXraKsNwu22tD5TGtWcl9brvJnvZQRKtw== X-Received: by 2002:a05:6122:2b5:b0:3a2:e753:904a with SMTP id 21-20020a05612202b500b003a2e753904amr4911110vkq.5.1664555841269; Fri, 30 Sep 2022 09:37:21 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:3736:5474:7f48:dc74:6616? ([2804:1b3:a7c2:3736:5474:7f48:dc74:6616]) by smtp.gmail.com with ESMTPSA id 6-20020a0561220a0600b0038c90405164sm2213683vkn.55.2022.09.30.09.37.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Sep 2022 09:37:20 -0700 (PDT) Message-ID: Date: Fri, 30 Sep 2022 13:37:18 -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 v3 2/2] malloc: Do not clobber errno on __getrandom_nocancel (BZ #29624) Content-Language: en-US To: Yann Droneaud , Wilco Dijkstra , "libc-alpha@sourceware.org" , Yu Chien Peter Lin References: <20220929192756.3310704-1-adhemerval.zanella@linaro.org> <20220929192756.3310704-2-adhemerval.zanella@linaro.org> <55da3486-8246-c18f-4676-569c385b968d@opteya.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <55da3486-8246-c18f-4676-569c385b968d@opteya.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 30/09/22 13:29, Yann Droneaud wrote: > Hi, > > Le 30/09/2022 à 17:09, Wilco Dijkstra via Libc-alpha a écrit : >> Hi Adhemerval, >> >> This looks good to me assuming Hurd is 32-bit only. >> >> Reviewed-by: Wilco Dijkstra >> >> Cheers, >> Wilco >> >> >> From: Adhemerval Zanella >>   Use INTERNAL_SYSCALL_CALL instead of INLINE_SYSCALL_CALL.  This >> requires emulate the semantic for hurd call (so __arc4random_buf >> uses the fallback). >> >> Checked on x86_64-linux-gnu. >> --- >> diff --git a/sysdeps/mach/hurd/not-cancel.h b/sysdeps/mach/hurd/not-cancel.h >> index ae58b734e3..5d2d2b4b8a 100644 >> --- a/sysdeps/mach/hurd/not-cancel.h >> +++ b/sysdeps/mach/hurd/not-cancel.h >> @@ -25,6 +25,7 @@ >>   #include >>   #include >>   #include >> +#include >>   #include >>   #include >>   @@ -75,8 +76,15 @@ __typeof (__fcntl) __fcntl_nocancel; >>   #define __fcntl64_nocancel(...) \ >>     __fcntl_nocancel (__VA_ARGS__) >>   -#define __getrandom_nocancel(buf, size, flags) \ >> -  __getrandom (buf, size, flags) >> +static inline int > > > ssize_t > > >> +__getrandom_nocancel (void *buf, size_t buflen, unsigned int flags) >> +{ >> +  int save_errno = errno; >> +  int r = __getrandom (buf, buflen, flags); > > ssize_t r Ack.