* [PATCH v2 1/2] misc: c2port: core: Make copying name from userspace more secure
@ 2020-11-02 14:20 Lee Jones
2020-11-02 14:20 ` [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description Lee Jones
0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2020-11-02 14:20 UTC (permalink / raw)
To: gregkh, arnd
Cc: linux-kernel, Lee Jones, Rodolfo Giometti, Eurotech S.p.A,
David Laight, Geert Uytterhoeven
Currently the 'c2dev' device data is not initialised when it's
allocated. There maybe an issue when using strncpy() to populate the
'name' attribute since a NUL terminator may not be provided in all
use-cases. To prevent such a failing, let's ensure the 'c2dev'
device data area is fully zeroed out on allocation.
Cc: Rodolfo Giometti <giometti@enneenne.com>
Cc: "Eurotech S.p.A" <info@eurotech.it>
Cc: David Laight <David.Laight@aculab.com>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/misc/c2port/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index 80d87e8a0bea9..fb9a1b49ff6de 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -899,7 +899,7 @@ struct c2port_device *c2port_device_register(char *name,
unlikely(!ops->c2d_get) || unlikely(!ops->c2d_set))
return ERR_PTR(-EINVAL);
- c2dev = kmalloc(sizeof(struct c2port_device), GFP_KERNEL);
+ c2dev = kzalloc(sizeof(struct c2port_device), GFP_KERNEL);
if (unlikely(!c2dev))
return ERR_PTR(-ENOMEM);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description
2020-11-02 14:20 [PATCH v2 1/2] misc: c2port: core: Make copying name from userspace more secure Lee Jones
@ 2020-11-02 14:20 ` Lee Jones
2020-11-02 14:29 ` Frederic Barrat
2020-11-03 0:01 ` Andrew Donnellan
0 siblings, 2 replies; 4+ messages in thread
From: Lee Jones @ 2020-11-02 14:20 UTC (permalink / raw)
To: gregkh, arnd
Cc: linux-kernel, Lee Jones, Frederic Barrat, Andrew Donnellan, linuxppc-dev
Fixes the following W=1 kernel build warning(s):
drivers/misc/ocxl/config.c:81: warning: Function parameter or member 'dev' not described in 'get_function_0'
drivers/misc/ocxl/config.c:81: warning: Excess function parameter 'device' description in 'get_function_0'
Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/misc/ocxl/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c
index 4d490b92d951f..a68738f382521 100644
--- a/drivers/misc/ocxl/config.c
+++ b/drivers/misc/ocxl/config.c
@@ -73,7 +73,7 @@ static int find_dvsec_afu_ctrl(struct pci_dev *dev, u8 afu_idx)
/**
* get_function_0() - Find a related PCI device (function 0)
- * @device: PCI device to match
+ * @dev: PCI device to match
*
* Returns a pointer to the related device, or null if not found
*/
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description
2020-11-02 14:20 ` [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description Lee Jones
@ 2020-11-02 14:29 ` Frederic Barrat
2020-11-03 0:01 ` Andrew Donnellan
1 sibling, 0 replies; 4+ messages in thread
From: Frederic Barrat @ 2020-11-02 14:29 UTC (permalink / raw)
To: Lee Jones, gregkh, arnd; +Cc: linux-kernel, Andrew Donnellan, linuxppc-dev
Le 02/11/2020 à 15:20, Lee Jones a écrit :
> Fixes the following W=1 kernel build warning(s):
>
> drivers/misc/ocxl/config.c:81: warning: Function parameter or member 'dev' not described in 'get_function_0'
> drivers/misc/ocxl/config.c:81: warning: Excess function parameter 'device' description in 'get_function_0'
>
> Cc: Frederic Barrat <fbarrat@linux.ibm.com>
> Cc: Andrew Donnellan <ajd@linux.ibm.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
Thanks!
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
> drivers/misc/ocxl/config.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c
> index 4d490b92d951f..a68738f382521 100644
> --- a/drivers/misc/ocxl/config.c
> +++ b/drivers/misc/ocxl/config.c
> @@ -73,7 +73,7 @@ static int find_dvsec_afu_ctrl(struct pci_dev *dev, u8 afu_idx)
>
> /**
> * get_function_0() - Find a related PCI device (function 0)
> - * @device: PCI device to match
> + * @dev: PCI device to match
> *
> * Returns a pointer to the related device, or null if not found
> */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description
2020-11-02 14:20 ` [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description Lee Jones
2020-11-02 14:29 ` Frederic Barrat
@ 2020-11-03 0:01 ` Andrew Donnellan
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Donnellan @ 2020-11-03 0:01 UTC (permalink / raw)
To: Lee Jones, gregkh, arnd; +Cc: linux-kernel, Frederic Barrat, linuxppc-dev
On 3/11/20 1:20 am, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/misc/ocxl/config.c:81: warning: Function parameter or member 'dev' not described in 'get_function_0'
> drivers/misc/ocxl/config.c:81: warning: Excess function parameter 'device' description in 'get_function_0'
>
> Cc: Frederic Barrat <fbarrat@linux.ibm.com>
> Cc: Andrew Donnellan <ajd@linux.ibm.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Thanks!
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-03 0:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 14:20 [PATCH v2 1/2] misc: c2port: core: Make copying name from userspace more secure Lee Jones
2020-11-02 14:20 ` [PATCH v2 2/2] misc: ocxl: config: Rename function attribute description Lee Jones
2020-11-02 14:29 ` Frederic Barrat
2020-11-03 0:01 ` Andrew Donnellan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).