s390: avoid format strings leaking into names
authorKees Cook <keescook@chromium.org>
Tue, 10 Jun 2014 17:46:20 +0000 (10:46 -0700)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 11 Jun 2014 08:13:27 +0000 (10:13 +0200)
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>
drivers/s390/block/dcssblk.c
drivers/s390/char/vmlogrdr.c
drivers/s390/crypto/zcrypt_api.c

index ee0e85abe1fd940fe6360a9444c4e7ed267dfd6c..0f471750327e5367075f2006f802a0e40653846f 100644 (file)
@@ -593,7 +593,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
        dev_info->start = dcssblk_find_lowest_addr(dev_info);
        dev_info->end = dcssblk_find_highest_addr(dev_info);
 
-       dev_set_name(&dev_info->dev, dev_info->segment_name);
+       dev_set_name(&dev_info->dev, "%s", dev_info->segment_name);
        dev_info->dev.release = dcssblk_release_segment;
        dev_info->dev.groups = dcssblk_dev_attr_groups;
        INIT_LIST_HEAD(&dev_info->lh);
index cf31d3321dab86b889b16fa5e3b9b2e433c3992d..a8848db7b09dd25f5d7dadb6a743dcb28f0262b0 100644 (file)
@@ -761,7 +761,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
 
        dev = kzalloc(sizeof(struct device), GFP_KERNEL);
        if (dev) {
-               dev_set_name(dev, priv->internal_name);
+               dev_set_name(dev, "%s", priv->internal_name);
                dev->bus = &iucv_bus;
                dev->parent = iucv_root;
                dev->driver = &vmlogrdr_driver;
index 5222ebe15705e14f8a0a9b2598b63ebb3672752f..0e18c5dcd91f3bfe28954dbd49cc626517ee6238 100644 (file)
@@ -356,7 +356,7 @@ struct zcrypt_ops *zcrypt_msgtype_request(unsigned char *name, int variant)
 
        zops = __ops_lookup(name, variant);
        if (!zops) {
-               request_module(name);
+               request_module("%s", name);
                zops = __ops_lookup(name, variant);
        }
        if ((!zops) || (!try_module_get(zops->owner)))