From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by sourceware.org (Postfix) with ESMTPS id 5C0303858C27 for ; Wed, 19 Jan 2022 14:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C0303858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=opensuse.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cristianrodriguez.net Received: by mail-ed1-f47.google.com with SMTP id m4so12270660edb.10 for ; Wed, 19 Jan 2022 06:08:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=S4g7tUIJQHMvL2+DDAT9a1BrA7g2DAQS0kkthszbL7E=; b=GMGkiC9Mu821EDr8fK7a2ewGtYQCPgG4uFT+wJIMs+r2WyIux0fzei/e9IOuYpzyYP KUqGT5aYecCh553WVbL0M9ztdid9N6XWX+CcuVPqiLLyd58z1ackTjxduXuGg0c5Dp81 A4VlQldZkJXWJj7ap7IP+dPoNxoyzYNRWsyOlzfPkyCOj87fJC0IkQhx3ZtGYW4FSzfL bg1YsC/ZEv+mdSMZ5iqXV9cH902C0fANSGnKPQQhkCVMnYIM2DmWLljOGLJbwEJGJn5i MThnrgylkFjH72hWgNIo+EcjvzcvwrK3oPC32YwhG8BU9eIYuxf0UtLzpOI5gGpuow1Y vcNA== X-Gm-Message-State: AOAM531xsuch6cQfm2CnXlskwyOVbWIo+jwG3x/w1dWniBH6nk7mKEf1 Vhr8XO5VbgQiLpEpRHxBRmh8DR02sREZ/CXiBqY2Fw== X-Google-Smtp-Source: ABdhPJzw5mzgjJe6h9f4THyQFNjgwp61536E1HfLvlz3ljwRgq/o9ypjEwsTCdPNY/zOVsM48Q5FDRCL0VrWiJQ2r4g= X-Received: by 2002:a05:600c:190a:: with SMTP id j10mr3688012wmq.55.1642601291088; Wed, 19 Jan 2022 06:08:11 -0800 (PST) MIME-Version: 1.0 References: <1642405014-3287-1-git-send-email-xuyang2018.jy@fujitsu.com> <61E6298D.80006@fujitsu.com> <61E64FED.2010906@fujitsu.com> <87r195i1lq.fsf@oldenburg.str.redhat.com> <61E7AC82.8080801@fujitsu.com> <61E7BBD6.3010706@fujitsu.com> In-Reply-To: From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Wed, 19 Jan 2022 11:07:59 -0300 Message-ID: Subject: Re: [PATCH] src/ext4_resize.c: set errno to 0 before the strtoull call To: "xuyang2018.jy@fujitsu.com" Cc: "morgan@kernel.org" , Florian Weimer , "Theodore Ts'o" , "libc-alpha@sourceware.org" , "fstests@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2022 14:08:14 -0000 On Wed, Jan 19, 2022 at 10:57 AM Cristian Rodr=C3=ADguez wrote: > This is not a glibc problem though, looks like lcap is clobbering > errno. I'd bet good CLP on the code called in > __attribute__((constructor (300))) static void _initialize_libcap(void) . > I strongly suggest not to use constructors on shared libraries unless > all the components using the library are in your control and you are > sure constructors will not ruin some other application's day. __attribute__((constructor (300))) static void _initialize_libcap(void) { if (_cap_max_bits) { return; } cap_set_syscall(NULL, NULL); --> nope _binary_search(_cap_max_bits, cap_get_bound, 0, __CAP_MAXBITS, __CAP_BITS); --> =F0=9F=A4=94 cap_proc_root("/proc"); } do, what cap_get_bound does ? int cap_get_bound(cap_value_t cap) { int result; result =3D prctl(PR_CAPBSET_READ, pr_arg(cap), pr_arg(0)); if (result < 0) { errno =3D -result; --> If all my bets paid , I would be rich.. here is your 1 return -1; } return result; }