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] [day] [month] [year] [list]
Message-ID: <9677a5bc-b867-4350-9848-6a726dc9d573@kernel.dk>
Date: Wed, 17 Jan 2024 16:05:22 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Yu Kuai <yukuai1@...weicloud.com>, Christoph Hellwig <hch@...radead.org>,
 Allison Karlitskaya <allison.karlitskaya@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
 "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: PROBLEM: BLKPG_DEL_PARTITION with GENHD_FL_NO_PART used to return
 ENXIO, now returns EINVAL

On 1/16/24 6:46 AM, Yu Kuai wrote:
> Hi,
> 
> ? 2024/01/16 21:23, Yu Kuai ??:
>> Hi, Christoph
>>
>> ? 2024/01/16 18:47, Christoph Hellwig ??:
>>> Hi Allison,
>>>
>>> please try this minimal fix.  I need to double check if we historically
>>> returned ENXIO or EINVAL for adding / resizing partitions, which would
>>> make things more complicated.  Or maybe you already have data for that
>>> at hand?
>>>
>>> diff --git a/block/ioctl.c b/block/ioctl.c
>>> index 9c73a763ef8838..f2028e39767821 100644
>>> --- a/block/ioctl.c
>>> +++ b/block/ioctl.c
>>> @@ -21,7 +21,7 @@ static int blkpg_do_ioctl(struct block_device *bdev,
>>>       sector_t start, length;
>>>       if (disk->flags & GENHD_FL_NO_PART)
>>> -        return -EINVAL;
>>> +        return -ENXIO;
>>
>> I think this might not be a proper fix, the reason if that before this
>> condition is added, -ENXIO is returned from bdev_del_partition(). And
>> there are also some other error number like -EACCES,-EFAULT following,
>> so this change will still make changes for user in other cases.
> 
> Please ignore the patch from last email. Sorry for the noise...
> bdev_resize_partition() will also return -ENXIO if partition does't
> exist. So the right patch should be following:

Can you send this out as a proper patch?

-- 
Jens Axboe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ