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 82DA21F45E for ; Tue, 11 Feb 2020 21:16:38 +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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=aPu6l sVCOVKnx5sAJByKs5U8DQoOPdqf+WFNTBr1AeqPyYJwKafhZbyr7tNWzpsICzMej nG6whd/4p0nWNzqCocOlo0SK6/23X3ytcBIIE+kRtQXUKySaFu452YYlyhAMI3Yo YvenRuT3Ixd0QUqXibHIB8v9Rxa5gBcueeDMC4= 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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=FyPJ6EqC+V4 j76K0+LalP1nUGFk=; b=AynjWInGFBfjey53LBxnfDhlneakGSWN1QbWuZRbliD OiVRl4/lu8fMZeNxE3/O/b7v829m/nGLpfXWSU7P7n5L5ZKDf3BggLLXKegAKWRt sbTRCifNse/yukZBfkr6RP5O9clZJqxjFk95eswMTCvplu8EEQWMiCOKElN+aQJ8 = Received: (qmail 13333 invoked by alias); 11 Feb 2020 21:16:35 -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 13291 invoked by uid 89); 11 Feb 2020 21:16:31 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: albireo.enyo.de From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 03/15] sparc: Use Linux kABI for syscall return 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> Date: Tue, 11 Feb 2020 22:15:04 +0100 In-Reply-To: (Adhemerval Zanella's message of "Tue, 11 Feb 2020 17:29:20 -0300") Message-ID: <87tv3wltbb.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain * 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.)