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]
Message-ID: <ZA+mroPKki9/iUkT@liuwe-devbox-debian-v2>
Date:   Mon, 13 Mar 2023 22:41:50 +0000
From:   Wei Liu <wei.liu@...nel.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, rafael@...nel.org,
        "David S. Miller" <davem@...emloft.net>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Alex Shi <alexs@...nel.org>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Alexandre Bounine <alex.bou9@...il.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Ben Widawsky <bwidawsk@...nel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Dexuan Cui <decui@...rosoft.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Hannes Reinecke <hare@...e.de>,
        Harald Freudenberger <freude@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Hu Haowen <src.res@...il.cn>,
        Ilya Dryomov <idryomov@...il.com>,
        Ira Weiny <ira.weiny@...el.com>,
        Iwona Winiarska <iwona.winiarska@...el.com>,
        Jakub Kicinski <kuba@...nel.org>, Jens Axboe <axboe@...nel.dk>,
        Jonathan Corbet <corbet@....net>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        Matt Porter <mporter@...nel.crashing.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Paolo Abeni <pabeni@...hat.com>,
        Stuart Yoder <stuyoder@...il.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Vishal Verma <vishal.l.verma@...el.com>,
        Wei Liu <wei.liu@...nel.org>,
        Yanteng Si <siyanteng@...ngson.cn>
Subject: Re: [PATCH 23/36] driver core: bus: mark the struct bus_type for
 sysfs callbacks as constant

On Mon, Mar 13, 2023 at 07:29:05PM +0100, Greg Kroah-Hartman wrote:
> struct bus_type should never be modified in a sysfs callback as there is
> nothing in the structure to modify, and frankly, the structure is almost
> never used in a sysfs callback, so mark it as constant to allow struct
> bus_type to be moved to read-only memory.
[...]
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index d24dd65b33d4..513adba09f56 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -684,7 +684,7 @@ static const struct attribute_group vmbus_dev_group = {
>  __ATTRIBUTE_GROUPS(vmbus_dev);
>  
>  /* Set up the attribute for /sys/bus/vmbus/hibernation */
> -static ssize_t hibernation_show(struct bus_type *bus, char *buf)
> +static ssize_t hibernation_show(const struct bus_type *bus, char *buf)
>  {
>  	return sprintf(buf, "%d\n", !!hv_is_hibernation_supported());
>  }

Acked-by: Wei Liu <wei.liu@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ