Skip to content

Commit ef28368

Browse files
keesMartin Schwidefsky
authored andcommitted
s390: avoid format strings leaking into names
This makes sure format strings can't accidentally leak into kernel interface names. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 0eb69a0 commit ef28368

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/s390/block/dcssblk.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
593593
dev_info->start = dcssblk_find_lowest_addr(dev_info);
594594
dev_info->end = dcssblk_find_highest_addr(dev_info);
595595

596-
dev_set_name(&dev_info->dev, dev_info->segment_name);
596+
dev_set_name(&dev_info->dev, "%s", dev_info->segment_name);
597597
dev_info->dev.release = dcssblk_release_segment;
598598
dev_info->dev.groups = dcssblk_dev_attr_groups;
599599
INIT_LIST_HEAD(&dev_info->lh);

‎drivers/s390/char/vmlogrdr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
761761

762762
dev = kzalloc(sizeof(struct device), GFP_KERNEL);
763763
if (dev) {
764-
dev_set_name(dev, priv->internal_name);
764+
dev_set_name(dev, "%s", priv->internal_name);
765765
dev->bus = &iucv_bus;
766766
dev->parent = iucv_root;
767767
dev->driver = &vmlogrdr_driver;

‎drivers/s390/crypto/zcrypt_api.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ struct zcrypt_ops *zcrypt_msgtype_request(unsigned char *name, int variant)
356356

357357
zops = __ops_lookup(name, variant);
358358
if (!zops) {
359-
request_module(name);
359+
request_module("%s", name);
360360
zops = __ops_lookup(name, variant);
361361
}
362362
if ((!zops) || (!try_module_get(zops->owner)))

0 commit comments

Comments
 (0)