All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] modpost: file2alias: define size of alias
@ 2019-02-07 12:30 ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-07 12:30 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml; +Cc: 2pi, linux-kbuild, linux-kernel

The size of the variable alias provided to do_entry functions are
currently not readily available. Thus hindering do_entry functions to
perform bounds checking.

Define the macro ALIAS_SIZE containing the size of the variable alias.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
---

Related discussion: [1] and [2] (around the first answer line)

[1]: https://lore.kernel.org/lkml/20190128150909.4r3tje5l34u5t2xs@mok.nu/
[2]: https://lore.kernel.org/lkml/CAHp75VcLizx+jtMrbc3Ev-HcJVEjH2naFC0sj=7fX5nZSCGc8Q@mail.gmail.com/

---

 scripts/mod/file2alias.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a37af7d71973..afe22af20d7d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -50,6 +50,9 @@ struct devtable {
 	int (*do_entry)(const char *filename, void *symval, char *alias);
 };
 
+/* Size of alias provided to do_entry functions */
+#define ALIAS_SIZE 500
+
 /* Define a variable f that holds the value of field f of struct devid
  * based at address m.
  */
@@ -1303,7 +1306,7 @@ static void do_table(void *symval, unsigned long size,
 		     struct module *mod)
 {
 	unsigned int i;
-	char alias[500];
+	char alias[ALIAS_SIZE];
 
 	device_id_check(mod->name, device_id, size, id_size, symval);
 	/* Leave last one: it's the terminator. */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] modpost: file2alias: define size of alias
@ 2019-02-07 12:30 ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-07 12:30 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml; +Cc: 2pi, linux-kbuild, linux-kernel

The size of the variable alias provided to do_entry functions are
currently not readily available. Thus hindering do_entry functions to
perform bounds checking.

Define the macro ALIAS_SIZE containing the size of the variable alias.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
---

Related discussion: [1] and [2] (around the first answer line)

[1]: https://lore.kernel.org/lkml/20190128150909.4r3tje5l34u5t2xs@mok.nu/
[2]: https://lore.kernel.org/lkml/CAHp75VcLizx+jtMrbc3Ev-HcJVEjH2naFC0sj=7fX5nZSCGc8Q@mail.gmail.com/

---

 scripts/mod/file2alias.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a37af7d71973..afe22af20d7d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -50,6 +50,9 @@ struct devtable {
 	int (*do_entry)(const char *filename, void *symval, char *alias);
 };
 
+/* Size of alias provided to do_entry functions */
+#define ALIAS_SIZE 500
+
 /* Define a variable f that holds the value of field f of struct devid
  * based at address m.
  */
@@ -1303,7 +1306,7 @@ static void do_table(void *symval, unsigned long size,
 		     struct module *mod)
 {
 	unsigned int i;
-	char alias[500];
+	char alias[ALIAS_SIZE];
 
 	device_id_check(mod->name, device_id, size, id_size, symval);
 	/* Leave last one: it's the terminator. */
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-02-07 12:30 ` Mattias Jacobsson
  (?)
@ 2019-02-18  7:20 ` Masahiro Yamada
  2019-02-19 20:08     ` Mattias Jacobsson
  -1 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2019-02-18  7:20 UTC (permalink / raw)
  To: Mattias Jacobsson
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

Hi Mattias,

On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
>
> The size of the variable alias provided to do_entry functions are
> currently not readily available. Thus hindering do_entry functions to
> perform bounds checking.
>
> Define the macro ALIAS_SIZE containing the size of the variable alias.
>
> Signed-off-by: Mattias Jacobsson <2pi@mok.nu>


Sorry for late reply.

I can apply this to my kbuild tree shortly, but
it looks like a prerequisite for your
"platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"


If you want all the patches to go through x86 platform-driver tree,
I am fine with that too.

Please let me know what you want.

Thanks.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-02-18  7:20 ` Masahiro Yamada
@ 2019-02-19 20:08     ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-19 20:08 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List, 2pi

Hi Masahiro,

On 2019-02-18, Masahiro Yamada wrote:
> Hi Mattias,
> 
> On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
> >
> > The size of the variable alias provided to do_entry functions are
> > currently not readily available. Thus hindering do_entry functions to
> > perform bounds checking.
> >
> > Define the macro ALIAS_SIZE containing the size of the variable alias.
> >
> > Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> 
> 
> Sorry for late reply.
> 
> I can apply this to my kbuild tree shortly, but
> it looks like a prerequisite for your
> "platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"
> 
> 
> If you want all the patches to go through x86 platform-driver tree,
> I am fine with that too.

I don't mind either way, however I've asked the x86 platform-driver
maintainers if they have a preference in this matter. You should have
received that mail otherwise see [1].

[1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu

> 
> Please let me know what you want.
> 
> Thanks.
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

Thanks,
Mattias

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
@ 2019-02-19 20:08     ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-19 20:08 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List, 2pi

Hi Masahiro,

On 2019-02-18, Masahiro Yamada wrote:
> Hi Mattias,
> 
> On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
> >
> > The size of the variable alias provided to do_entry functions are
> > currently not readily available. Thus hindering do_entry functions to
> > perform bounds checking.
> >
> > Define the macro ALIAS_SIZE containing the size of the variable alias.
> >
> > Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> 
> 
> Sorry for late reply.
> 
> I can apply this to my kbuild tree shortly, but
> it looks like a prerequisite for your
> "platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"
> 
> 
> If you want all the patches to go through x86 platform-driver tree,
> I am fine with that too.

I don't mind either way, however I've asked the x86 platform-driver
maintainers if they have a preference in this matter. You should have
received that mail otherwise see [1].

[1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu

> 
> Please let me know what you want.
> 
> Thanks.
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

Thanks,
Mattias

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-02-19 20:08     ` Mattias Jacobsson
  (?)
@ 2019-02-19 23:47     ` Masahiro Yamada
  2019-02-23 19:57         ` Mattias Jacobsson
  -1 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2019-02-19 23:47 UTC (permalink / raw)
  To: Mattias Jacobsson
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

On Wed, Feb 20, 2019 at 5:09 AM Mattias Jacobsson <2pi@mok.nu> wrote:
>
> Hi Masahiro,
>
> On 2019-02-18, Masahiro Yamada wrote:
> > Hi Mattias,
> >
> > On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
> > >
> > > The size of the variable alias provided to do_entry functions are
> > > currently not readily available. Thus hindering do_entry functions to
> > > perform bounds checking.
> > >
> > > Define the macro ALIAS_SIZE containing the size of the variable alias.
> > >
> > > Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> >
> >
> > Sorry for late reply.
> >
> > I can apply this to my kbuild tree shortly, but
> > it looks like a prerequisite for your
> > "platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"
> >
> >
> > If you want all the patches to go through x86 platform-driver tree,
> > I am fine with that too.
>
> I don't mind either way, however I've asked the x86 platform-driver
> maintainers if they have a preference in this matter. You should have
> received that mail otherwise see [1].
>
> [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu


I saw it.  The 2/8 uses ALIAS_SIZE.

So, I think it will be better to include this one in your series.
If necessary, please feel free to add

Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>


> >
> > Please let me know what you want.
> >
> > Thanks.
> >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
>
> Thanks,
> Mattias



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-02-19 23:47     ` Masahiro Yamada
@ 2019-02-23 19:57         ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-23 19:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List, 2pi

On 2019-02-20, Masahiro Yamada wrote:
> On Wed, Feb 20, 2019 at 5:09 AM Mattias Jacobsson <2pi@mok.nu> wrote:
> >
> > Hi Masahiro,
> >
> > On 2019-02-18, Masahiro Yamada wrote:
> > > Hi Mattias,
> > >
> > > On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
> > > >
> > > > The size of the variable alias provided to do_entry functions are
> > > > currently not readily available. Thus hindering do_entry functions to
> > > > perform bounds checking.
> > > >
> > > > Define the macro ALIAS_SIZE containing the size of the variable alias.
> > > >
> > > > Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> > >
> > >
> > > Sorry for late reply.
> > >
> > > I can apply this to my kbuild tree shortly, but
> > > it looks like a prerequisite for your
> > > "platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"
> > >
> > >
> > > If you want all the patches to go through x86 platform-driver tree,
> > > I am fine with that too.
> >
> > I don't mind either way, however I've asked the x86 platform-driver
> > maintainers if they have a preference in this matter. You should have
> > received that mail otherwise see [1].
> >
> > [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu
> 
> 
> I saw it.  The 2/8 uses ALIAS_SIZE.
> 
> So, I think it will be better to include this one in your series.
> If necessary, please feel free to add
> 
> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> 

Okey, will do. Thanks!

> 
> > >
> > > Please let me know what you want.
> > >
> > > Thanks.
> > >
> > >
> > >
> > > --
> > > Best Regards
> > > Masahiro Yamada
> >
> > Thanks,
> > Mattias
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

Thanks,
Mattias

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
@ 2019-02-23 19:57         ` Mattias Jacobsson
  0 siblings, 0 replies; 11+ messages in thread
From: Mattias Jacobsson @ 2019-02-23 19:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List, 2pi

On 2019-02-20, Masahiro Yamada wrote:
> On Wed, Feb 20, 2019 at 5:09 AM Mattias Jacobsson <2pi@mok.nu> wrote:
> >
> > Hi Masahiro,
> >
> > On 2019-02-18, Masahiro Yamada wrote:
> > > Hi Mattias,
> > >
> > > On Thu, Feb 7, 2019 at 9:31 PM Mattias Jacobsson <2pi@mok.nu> wrote:
> > > >
> > > > The size of the variable alias provided to do_entry functions are
> > > > currently not readily available. Thus hindering do_entry functions to
> > > > perform bounds checking.
> > > >
> > > > Define the macro ALIAS_SIZE containing the size of the variable alias.
> > > >
> > > > Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> > >
> > >
> > > Sorry for late reply.
> > >
> > > I can apply this to my kbuild tree shortly, but
> > > it looks like a prerequisite for your
> > > "platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()"
> > >
> > >
> > > If you want all the patches to go through x86 platform-driver tree,
> > > I am fine with that too.
> >
> > I don't mind either way, however I've asked the x86 platform-driver
> > maintainers if they have a preference in this matter. You should have
> > received that mail otherwise see [1].
> >
> > [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu
> 
> 
> I saw it.  The 2/8 uses ALIAS_SIZE.
> 
> So, I think it will be better to include this one in your series.
> If necessary, please feel free to add
> 
> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> 

Okey, will do. Thanks!

> 
> > >
> > > Please let me know what you want.
> > >
> > > Thanks.
> > >
> > >
> > >
> > > --
> > > Best Regards
> > > Masahiro Yamada
> >
> > Thanks,
> > Mattias
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada

Thanks,
Mattias

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-02-23 19:57         ` Mattias Jacobsson
  (?)
@ 2019-03-07  6:09         ` Darren Hart
  2019-03-07  6:17           ` Darren Hart
  -1 siblings, 1 reply; 11+ messages in thread
From: Darren Hart @ 2019-03-07  6:09 UTC (permalink / raw)
  To: Mattias Jacobsson
  Cc: Masahiro Yamada, Michal Marek, Linux Kbuild mailing list,
	Linux Kernel Mailing List

On Sat, Feb 23, 2019 at 08:57:50PM +0100, Mattias Jacobsson wrote:
> On 2019-02-20, Masahiro Yamada wrote:

> > > > If you want all the patches to go through x86 platform-driver tree,
> > > > I am fine with that too.
> > >
> > > I don't mind either way, however I've asked the x86 platform-driver
> > > maintainers if they have a preference in this matter. You should have
> > > received that mail otherwise see [1].
> > >
> > > [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu
> > 
> > 
> > I saw it.  The 2/8 uses ALIAS_SIZE.
> > 
> > So, I think it will be better to include this one in your series.
> > If necessary, please feel free to add
> > 
> > Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > 
> 
> Okey, will do. Thanks!


Agree, I'll pull it in.


-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-03-07  6:09         ` Darren Hart
@ 2019-03-07  6:17           ` Darren Hart
  2019-03-07  6:20             ` Masahiro Yamada
  0 siblings, 1 reply; 11+ messages in thread
From: Darren Hart @ 2019-03-07  6:17 UTC (permalink / raw)
  To: Mattias Jacobsson
  Cc: Masahiro Yamada, Michal Marek, Linux Kbuild mailing list,
	Linux Kernel Mailing List

On Wed, Mar 06, 2019 at 10:09:26PM -0800, Darren Hart wrote:
> On Sat, Feb 23, 2019 at 08:57:50PM +0100, Mattias Jacobsson wrote:
> > On 2019-02-20, Masahiro Yamada wrote:
> 
> > > > > If you want all the patches to go through x86 platform-driver tree,
> > > > > I am fine with that too.
> > > >
> > > > I don't mind either way, however I've asked the x86 platform-driver
> > > > maintainers if they have a preference in this matter. You should have
> > > > received that mail otherwise see [1].
> > > >
> > > > [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu
> > > 
> > > 
> > > I saw it.  The 2/8 uses ALIAS_SIZE.
> > > 
> > > So, I think it will be better to include this one in your series.
> > > If necessary, please feel free to add
> > > 
> > > Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > 
> > 
> > Okey, will do. Thanks!
> 
> 
> Agree, I'll pull it in.

Masahiro, may I include your Acked-by on the 2/8 patch as well?

platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] modpost: file2alias: define size of alias
  2019-03-07  6:17           ` Darren Hart
@ 2019-03-07  6:20             ` Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: Masahiro Yamada @ 2019-03-07  6:20 UTC (permalink / raw)
  To: Darren Hart
  Cc: Mattias Jacobsson, Michal Marek, Linux Kbuild mailing list,
	Linux Kernel Mailing List

Hi Darren,


On Thu, Mar 7, 2019 at 3:17 PM Darren Hart <dvhart@infradead.org> wrote:
>
> On Wed, Mar 06, 2019 at 10:09:26PM -0800, Darren Hart wrote:
> > On Sat, Feb 23, 2019 at 08:57:50PM +0100, Mattias Jacobsson wrote:
> > > On 2019-02-20, Masahiro Yamada wrote:
> >
> > > > > > If you want all the patches to go through x86 platform-driver tree,
> > > > > > I am fine with that too.
> > > > >
> > > > > I don't mind either way, however I've asked the x86 platform-driver
> > > > > maintainers if they have a preference in this matter. You should have
> > > > > received that mail otherwise see [1].
> > > > >
> > > > > [1]: https://lkml.kernel.org/r/082d3d38b7dde6050b6b3e518ada439eade65b2c.1550603967.git.2pi@mok.nu
> > > >
> > > >
> > > > I saw it.  The 2/8 uses ALIAS_SIZE.
> > > >
> > > > So, I think it will be better to include this one in your series.
> > > > If necessary, please feel free to add
> > > >
> > > > Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > >
> > >
> > > Okey, will do. Thanks!
> >
> >
> > Agree, I'll pull it in.
>
> Masahiro, may I include your Acked-by on the 2/8 patch as well?


Sure.  Please go ahead.




> platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
>
> --
> Darren Hart
> VMware Open Source Technology Center



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-03-07  6:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 12:30 [PATCH] modpost: file2alias: define size of alias Mattias Jacobsson
2019-02-07 12:30 ` Mattias Jacobsson
2019-02-18  7:20 ` Masahiro Yamada
2019-02-19 20:08   ` Mattias Jacobsson
2019-02-19 20:08     ` Mattias Jacobsson
2019-02-19 23:47     ` Masahiro Yamada
2019-02-23 19:57       ` Mattias Jacobsson
2019-02-23 19:57         ` Mattias Jacobsson
2019-03-07  6:09         ` Darren Hart
2019-03-07  6:17           ` Darren Hart
2019-03-07  6:20             ` Masahiro Yamada

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.