From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] lib: switch cgroup bit-fields from signed to unsigned int
Date: Fri, 24 Jan 2025 12:19:57 +0100 [thread overview]
Message-ID: <Z5N3XdwnqOthwIps@yuki.lan> (raw)
In-Reply-To: <20250118102615.127485-1-liwang@redhat.com>
Hi!
> There is a problem in cgroup lib that the declearation int
> can lead to -1 during the | operation.
>
> Becasue if the field contains uninitialized garbage data,
> a bit-field declared as int could interpret 0b1 as -1 due
> to signed arithmetic.
Uff, so we have a number that can be either -1 or 0. Where did it break?
I suppose that things are okay as long as we do if (s->bar | s->bar).
Anyways:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-24 11:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-18 10:26 [LTP] [PATCH] lib: switch cgroup bit-fields from signed to unsigned int Li Wang
2025-01-23 20:50 ` Petr Vorel
2025-01-24 11:19 ` Cyril Hrubis [this message]
2025-01-25 2:43 ` Li Wang
2025-01-25 2:46 ` Li Wang
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=Z5N3XdwnqOthwIps@yuki.lan \
--to=chrubis@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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.