Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1547335 > unrolled thread
| Started by | Bhumika Goyal <bhumirks@gmail.com> |
|---|---|
| First post | 2016-12-26 16:40 +0100 |
| Last post | 2017-01-11 22:10 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr Bhumika Goyal <bhumirks@gmail.com> - 2016-12-26 16:40 +0100
Re: [PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr Kees Cook <keescook@chromium.org> - 2017-01-04 00:20 +0100
Re: [PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr Bjorn Helgaas <helgaas@kernel.org> - 2017-01-11 22:10 +0100
| From | Bhumika Goyal <bhumirks@gmail.com> |
|---|---|
| Date | 2016-12-26 16:40 +0100 |
| Subject | [PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr |
| Message-ID | <sSFxv-6wi-9@gated-at.bofh.it> |
The object ibm_apci_table_attr of type bin_attribute structure is not
modified after getting initialized by ibm_acpiphp_init. Apart from
getting referenced in init it is also passed as an argument to the functions
sysfs_{remove/create}_bin_file but both the arguments are of type const
struct bin_attribute *. Therefore add __ro_after_init to its declaration.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/pci/hotplug/acpiphp_ibm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index f6221d7..188cdfa 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -107,7 +107,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
static acpi_handle ibm_acpi_handle;
static struct notification ibm_note;
-static struct bin_attribute ibm_apci_table_attr = {
+static struct bin_attribute ibm_apci_table_attr __ro_after_init = {
.attr = {
.name = "apci_table",
.mode = S_IRUGO,
--
1.9.1
[toc] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-01-04 00:20 +0100 |
| Message-ID | <sVGx4-4OV-7@gated-at.bofh.it> |
| In reply to | #1547335 |
On Mon, Dec 26, 2016 at 7:36 AM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> The object ibm_apci_table_attr of type bin_attribute structure is not
> modified after getting initialized by ibm_acpiphp_init. Apart from
> getting referenced in init it is also passed as an argument to the functions
> sysfs_{remove/create}_bin_file but both the arguments are of type const
> struct bin_attribute *. Therefore add __ro_after_init to its declaration.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> drivers/pci/hotplug/acpiphp_ibm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
> index f6221d7..188cdfa 100644
> --- a/drivers/pci/hotplug/acpiphp_ibm.c
> +++ b/drivers/pci/hotplug/acpiphp_ibm.c
> @@ -107,7 +107,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
>
> static acpi_handle ibm_acpi_handle;
> static struct notification ibm_note;
> -static struct bin_attribute ibm_apci_table_attr = {
> +static struct bin_attribute ibm_apci_table_attr __ro_after_init = {
> .attr = {
> .name = "apci_table",
> .mode = S_IRUGO,
Thanks!
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
--
Kees Cook
Nexus Security
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-01-11 22:10 +0100 |
| Subject | Re: [PATCH] PCI: acpiphp_ibm: add __ro_after_init to ibm_apci_table_attr |
| Message-ID | <sYyjE-3tR-13@gated-at.bofh.it> |
| In reply to | #1547335 |
On Mon, Dec 26, 2016 at 09:06:35PM +0530, Bhumika Goyal wrote:
> The object ibm_apci_table_attr of type bin_attribute structure is not
> modified after getting initialized by ibm_acpiphp_init. Apart from
> getting referenced in init it is also passed as an argument to the functions
> sysfs_{remove/create}_bin_file but both the arguments are of type const
> struct bin_attribute *. Therefore add __ro_after_init to its declaration.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied to pci/hotplug for v4.11 with Kees' Reviewed-by and the following
changelog:
PCI: acpiphp_ibm: Make ibm_apci_table_attr __ro_after_init
ibm_apci_table_attr is not modified after being initialized by
ibm_acpiphp_init(). It is passed as an argument to the functions
sysfs_{remove/create}_bin_file(), but both the arguments are const.
Add __ro_after_init to its declaration.
[bhelgaas: changelog]
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/pci/hotplug/acpiphp_ibm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
> index f6221d7..188cdfa 100644
> --- a/drivers/pci/hotplug/acpiphp_ibm.c
> +++ b/drivers/pci/hotplug/acpiphp_ibm.c
> @@ -107,7 +107,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
>
> static acpi_handle ibm_acpi_handle;
> static struct notification ibm_note;
> -static struct bin_attribute ibm_apci_table_attr = {
> +static struct bin_attribute ibm_apci_table_attr __ro_after_init = {
> .attr = {
> .name = "apci_table",
> .mode = S_IRUGO,
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web