lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907030852.24912.a.miskiewicz@gmail.com>
Date:	Fri, 3 Jul 2009 08:52:24 +0200
From:	Arkadiusz Miskiewicz <a.miskiewicz@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: Re: Linux 2.6.27.26

On Friday 03 of July 2009, Greg KH wrote:

Isn't this part broken?

The code in 2.6.27 already has such thing and new code is trying to return 
NULL even if function returns int

static int dm_blk_open(struct inode *inode, struct file *file)
{
        struct mapped_device *md;

        spin_lock(&_minor_lock);

        md = inode->i_bdev->bd_disk->private_data;
        if (!md)
                goto out;

        if (test_bit(DMF_FREEING, &md->flags) ||
            test_bit(DMF_DELETING, &md->flags)) {
                md = NULL;
                goto out;
        }

        dm_get(md);
        atomic_inc(&md->open_count);

out:
        spin_unlock(&_minor_lock);

        return md ? 0 : -ENXIO;
}


> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index ace998c..925efaf 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -265,6 +265,10 @@ static int dm_blk_open(struct inode *inode, struct
> file *file) goto out;
>         }
>  
> +       if (test_bit(DMF_FREEING, &md->flags) ||
> +           test_bit(DMF_DELETING, &md->flags))
> +               return NULL;
> +
>         dm_get(md);
>         atomic_inc(&md->open_count);
>  


-- 
Arkadiusz Miƛkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ