Skip to content

Commit 757ab8f

Browse files
author
Mete Durlu
committed
s390/iucv: Fix vargs handling in iucv_alloc_device()
JIRA: https://issues.redhat.com/browse/RHEL-50786 Upstream status: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Tested: by IBM Build-Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=65307356 Conflicts: None commit 0124fb0 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: 4452e8e ("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@linux.ibm.com> Reviewed-by: Thorsten Winkler <twinkler@linux.ibm.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/20240821091337.3627068-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent 8372a7e commit 757ab8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/iucv/iucv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ struct device *iucv_alloc_device(const struct attribute_group **attrs,
8787
{
8888
struct device *dev;
8989
va_list vargs;
90+
char buf[20];
9091
int rc;
9192

9293
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
9394
if (!dev)
9495
goto out_error;
9596
va_start(vargs, fmt);
96-
rc = dev_set_name(dev, fmt, vargs);
97+
vsnprintf(buf, sizeof(buf), fmt, vargs);
98+
rc = dev_set_name(dev, "%s", buf);
9799
va_end(vargs);
98100
if (rc)
99101
goto out_error;

0 commit comments

Comments
 (0)