All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrew G. Morgan" <morgan@kernel.org>
To: "Cristian Rodríguez" <crrodriguez@opensuse.org>
Cc: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>,
	Florian Weimer <fweimer@redhat.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	"fstests@vger.kernel.org" <fstests@vger.kernel.org>
Subject: Re: [PATCH] src/ext4_resize.c: set errno to 0 before the strtoull call
Date: Wed, 19 Jan 2022 06:50:41 -0800	[thread overview]
Message-ID: <CALQRfL4wBQc_tT3b8daivFh7nxad0kfhG7MM2Nx=_nHJ-myphQ@mail.gmail.com> (raw)
In-Reply-To: <CAPBLoAc3H_+aZbZTakODK9Azz7qvpc_SnCh4U5Jxfx0TWKcDsg@mail.gmail.com>

Thanks for finding this.

Fixed in:

https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=f25a1b7e69f7b33e6afb58b3e38f3450b7d2d9a0

Cheers

Andrew

On Wed, Jan 19, 2022 at 6:08 AM Cristian Rodríguez
<crrodriguez@opensuse.org> wrote:
>
> On Wed, Jan 19, 2022 at 10:57 AM Cristian Rodríguez
> <crrodriguez@opensuse.org> 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); --> 🤔
>     cap_proc_root("/proc");
> }
>
> do, what cap_get_bound does ?
>
> int cap_get_bound(cap_value_t cap)
> {
>     int result;
>
>     result = prctl(PR_CAPBSET_READ, pr_arg(cap), pr_arg(0));
>     if (result < 0) {
>         errno = -result; --> If all my bets paid , I would be rich..
> here is your 1
>         return -1;
>     }
>     return result;
> }

  reply	other threads:[~2022-01-19 14:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17  7:36 [PATCH] src/ext4_resize.c: set errno to 0 before the strtoull call Yang Xu
2022-01-17 17:07 ` Darrick J. Wong
2022-01-18  2:32 ` Theodore Ts'o
2022-01-18  2:43   ` xuyang2018.jy
2022-01-18  3:56     ` Theodore Ts'o
2022-01-18  5:27       ` xuyang2018.jy
2022-01-18 11:23         ` Adhemerval Zanella
2022-01-18 11:26           ` Florian Weimer
2022-01-18 11:49             ` Adhemerval Zanella
2022-01-18 12:00               ` Florian Weimer
2022-01-18 12:04               ` Andreas Schwab
2022-01-18 12:26                 ` Adhemerval Zanella
2022-01-18 14:02         ` Florian Weimer
     [not found]           ` <61E7AC82.8080801@fujitsu.com>
2022-01-19  7:19             ` xuyang2018.jy
2022-01-19 13:57               ` Cristian Rodríguez
2022-01-19 14:07                 ` Cristian Rodríguez
2022-01-19 14:50                   ` Andrew G. Morgan [this message]
2022-01-19 20:13                     ` Theodore Ts'o
2022-01-18 14:22         ` Andreas Schwab
2022-01-18 14:29           ` H.J. Lu
2022-01-19  2:07           ` xuyang2018.jy
2022-01-19  8:23             ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALQRfL4wBQc_tT3b8daivFh7nxad0kfhG7MM2Nx=_nHJ-myphQ@mail.gmail.com' \
    --to=morgan@kernel.org \
    --cc=crrodriguez@opensuse.org \
    --cc=fstests@vger.kernel.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=tytso@mit.edu \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.