lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 May 2022 08:52:37 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Miguel Ojeda <ojeda@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        rust-for-linux@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Li Li <dualli@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Wedson Almeida Filho <wedsonaf@...gle.com>
Subject: Re: [PATCH v1] binder: convert `BINDER_*` ioctl `#define`s into an `enum`

On Mon, May 16, 2022 at 11:04 AM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> -#define BINDER_WRITE_READ              _IOWR('b', 1, struct binder_write_read)
> -#define BINDER_SET_IDLE_TIMEOUT                _IOW('b', 3, __s64)
> -#define BINDER_SET_MAX_THREADS         _IOW('b', 5, __u32)
> -#define BINDER_SET_IDLE_PRIORITY       _IOW('b', 6, __s32)
> -#define BINDER_SET_CONTEXT_MGR         _IOW('b', 7, __s32)
> -#define BINDER_THREAD_EXIT             _IOW('b', 8, __s32)
> -#define BINDER_VERSION                 _IOWR('b', 9, struct binder_version)
> -#define BINDER_GET_NODE_DEBUG_INFO     _IOWR('b', 11, struct binder_node_debug_info)
> -#define BINDER_GET_NODE_INFO_FOR_REF   _IOWR('b', 12, struct binder_node_info_for_ref)
> -#define BINDER_SET_CONTEXT_MGR_EXT     _IOW('b', 13, struct flat_binder_object)
> -#define BINDER_FREEZE                  _IOW('b', 14, struct binder_freeze_info)
> -#define BINDER_GET_FROZEN_INFO         _IOWR('b', 15, struct binder_frozen_status_info)
> -#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION    _IOW('b', 16, __u32)
> +enum {
> +       BINDER_WRITE_READ                       = _IOWR('b', 1, struct binder_write_read),
> +       BINDER_SET_IDLE_TIMEOUT                 = _IOW('b', 3, __s64),
> +       BINDER_SET_MAX_THREADS                  = _IOW('b', 5, __u32),
> +       BINDER_SET_IDLE_PRIORITY                = _IOW('b', 6, __s32),
> +       BINDER_SET_CONTEXT_MGR                  = _IOW('b', 7, __s32),
> +       BINDER_THREAD_EXIT                      = _IOW('b', 8, __s32),
> +       BINDER_VERSION                          = _IOWR('b', 9, struct binder_version),

I wonder if that breaks any tools that extract ioctl command number definitions
from kernel headers. I see one other header using enum, but everything else
has the #define. The main user of ioctl command definitions that comes to
mind is 'strace', but I don't know where they get the numbers from.

It's probably not a big deal as long as it's limited to binder, but it
may become
more of a problem if we do this for more subsystems over time.

         Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ