From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8533B1F45E for ; Wed, 12 Feb 2020 12:35:53 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=yAhf5vajwHs1cEFI WAcnnwwVZ0PZM7ojayqWEEkrqOn5yT2RzacyOX+revzF2B8Likp0RxozD0K8ZrWM NRsqHz9kjskSRPACo1/SDqbdxMJhJHBRg1Ia+RNooGkDfepelwgF4DsKj8R8rAAR laYa2cZUpEZ0DRzSw05bylXjhKE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=pwszTfPB5NH+93+P3KON0c OfU7E=; b=Wfc4wQaGKd6dvhdETXeEJ14no/rI5Y0W7271dcefnX9Ohzt61aBObQ qq34iOw+wofyN/WNFj4jzXvBgWDZCxBfg3uW/okWIjAkbm74hX6kcpDwT0tkGtYJ g58ZtNqtYlB/cA+L3dbaUMjioHd4qhocfTSpZt6uFkpTtVEBkVK9Y= Received: (qmail 77964 invoked by alias); 12 Feb 2020 12:35:50 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 77937 invoked by uid 89); 12 Feb 2020 12:35:50 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qk1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hHppiY7c8Ym2TlOqzk6ESUX1Hge+tOGSa54qhRoMU6g=; b=L1Ibx3y2qIFtnxrptfULZ1cexSooR8vmyJ8bk7Yw/PJcNICEGrsTfgIZP1hfkZCTom /gaWGAj1eBq9/0W1JSX56Ng77KksRgkyFxL4i0CmlERn9FDCBbLZZSVelExdhRArsZxv wc9PEznTCPgUvFDgoFhhVPrU22BL/dAsadZNh0/g7NS9sw/iUgSgbWcyl3/Qwq84CXOX hmwZ/Zm40vyBmxuLEBqdG92ZDB4p7OuytmtBlpWwFcu7fW7jKlhirnf5DkzMB+mjzHpZ +goDb9mUe/NojWTHcBO7qe9XL/7NrLY9i1fDogMHSQAS8P+wY6ZKHXts96N/trY7w2tL J1Zw== To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20200210192038.23588-1-adhemerval.zanella@linaro.org> <20200210192038.23588-3-adhemerval.zanella@linaro.org> <878sl9pe78.fsf@oldenburg2.str.redhat.com> <10c5636d-6ea7-e95c-3a3c-67be298472fd@linaro.org> <874kvxnczu.fsf@mid.deneb.enyo.de> <87tv3wltbb.fsf@mid.deneb.enyo.de> From: Adhemerval Zanella Subject: Re: [PATCH 03/15] sparc: Use Linux kABI for syscall return Message-ID: <7b15c63a-8379-d549-1a31-83803a365c5e@linaro.org> Date: Wed, 12 Feb 2020 09:35:39 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <87tv3wltbb.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/02/2020 18:15, Florian Weimer wrote: > * Adhemerval Zanella: > >>> But ERESTART_RESTARTBLOCK is not 4095, so glibc with this change will >>> now treat certain internal kernel error codes as errors, while they >>> were previously reported as success. This looks like a kernel bug, in >>> that ERESTART_RESTARTBLOCK was not updated when more error codes were >>> added. On the other hand, these error codes should never leak into >>> userspace. >> >> My understanding is such errors should not be visible by the application, >> as indicated by include/linux/errno.h comment. And it seems to be the >> case for sparc, at least on: > > These error codes tend to leak from device drivers and other less > scrutinized parts of the kernel. It's not actually about the > ERESTART_RESTARTBLOCK value as such, there are other values larger > than that: > > #define ERESTART_RESTARTBLOCK 516 /* restart by calling sys_restart_syscall */ > #define EPROBE_DEFER 517 /* Driver requests probe retry */ > #define EOPENSTALE 518 /* open found a stale dentry */ > #define ENOPARAM 519 /* Parameter not supported */ > > /* Defined for the NFSv3 protocol */ > #define EBADHANDLE 521 /* Illegal NFS file handle */ > #define ENOTSYNC 522 /* Update synchronization mismatch */ > #define EBADCOOKIE 523 /* Cookie is stale */ > #define ENOTSUPP 524 /* Operation is not supported */ > > And so on. > > Like I said, it looks like someone forgot to update this code. It > probably should use the 4095 boundary and not specific error codes > anyway. (We had a similar problem in glibc itself in the s390 > socketcall support.) This code seems to come from since initial git repository (Linux-2.6.12-rc2). >From a glibc standpoint, the error handling will be the same in fact, since what indicates the syscall has failed is the carry condition code value, not the syscall returned value ('o0' register).