[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e5bb753-9d6b-4e6f-8b02-ffa2cae1a4f7@intel.com>
Date: Tue, 20 Aug 2024 13:51:06 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Alexandra Winter <wintera@...ux.ibm.com>
CC: <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>, "Jakub
Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Eric Dumazet
<edumazet@...gle.com>, <linux-s390@...r.kernel.org>, Heiko Carstens
<hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev
<agordeev@...ux.ibm.com>, Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Thorsten Winkler
<twinkler@...ux.ibm.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH net v2] s390/iucv: Fix vargs handling in
iucv_alloc_device()
On 8/20/24 10:45, Alexandra Winter wrote:
> iucv_alloc_device() gets a format string and a varying number of
> arguments. This is incorrectly forwarded by calling dev_set_name() with
> the format string and a va_list, while dev_set_name() expects also a
> varying number of arguments.
>
> Symptoms:
> Corrupted iucv device names, which can result in log messages like:
> sysfs: cannot create duplicate filename '/devices/iucv/hvc_iucv1827699952'
>
> Fixes: 4452e8ef8c36 ("s390/iucv: Provide iucv_alloc_device() / iucv_release_device()")
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1228425
> Signed-off-by: Alexandra Winter <wintera@...ux.ibm.com>
> Reviewed-by: Thorsten Winkler <twinkler@...ux.ibm.com>
> ---
> Discussion of v1:
> Link: https://lore.kernel.org/all/2024081326-shifter-output-cb8f@gregkh/T/#mf8ae979de8acdc01f7ede0b94af6f2e110eea209
side note: that's nice that you have continued Vasily's series as your
own v2
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202408091131.ATGn6YSh-lkp@intel.com/
> Vasily Gorbik asked me to send this version via the netdev mailing list.
> ---
> net/iucv/iucv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
> index 1e42e13ad24e..2e615641a4e5 100644
> --- a/net/iucv/iucv.c
> +++ b/net/iucv/iucv.c
> @@ -86,13 +86,15 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs,
> {
> struct device *dev;
> va_list vargs;
> + char buf[20];
> int rc;
>
> dev = kzalloc(sizeof(*dev), GFP_KERNEL);
> if (!dev)
> goto out_error;
> va_start(vargs, fmt);
> - rc = dev_set_name(dev, fmt, vargs);
> + vsnprintf(buf, sizeof(buf), fmt, vargs);
> + rc = dev_set_name(dev, buf);
would be good to pass "%s" as fmt to dev_set_name()
otherwise this patch is good for me, so please add my:
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> va_end(vargs);
> if (rc)
> goto out_error;
Powered by blists - more mailing lists