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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7458912f-d3a3-4cf7-b668-eb0e78590b75@kernel.dk>
Date: Tue, 3 Jun 2025 17:46:17 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Anuj gupta <anuj1072538@...il.com>
Cc: Caleb Sander Mateos <csander@...estorage.com>,
 linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: flip iter directions in
 blk_rq_integrity_map_user()

On 6/3/25 5:34 PM, Anuj gupta wrote:
> On Wed, Jun 4, 2025 at 12:24?AM Jens Axboe <axboe@...nel.dk> wrote:
>>
>> On 6/3/25 12:47 PM, Caleb Sander Mateos wrote:
>>> blk_rq_integrity_map_user() creates the ubuf iter with ITER_DEST for
>>> write-direction operations and ITER_SOURCE for read-direction ones.
>>> This is backwards; writes use the user buffer as a source for metadata
>>> and reads use it as a destination. Switch to the rq_data_dir() helper,
>>> which maps writes to ITER_SOURCE (WRITE) and reads to ITER_DEST(READ).
>>
>> Was going to ask "how did this ever work without splats", but looks like
>> a fairly recent change AND it's for integrity which isn't widely used.
>> But it does show a gap in testing for sure.
>>
> 
> Yes, you're absolutely right. blk_rq_integrity_map_user() is currently
> only used by nvme-passthru, and Keith recently added a test for that
> path [1].
> 
> As for the user block integrity interface in general ? it?s been a bit
> tricky to write generic tests so far, mostly because there's no way to
> query the device's integrity capabilities from userspace. But that
> should become much easier once we have support for that via an ioctl[2].
> 
> [1] https://lore.kernel.org/io-uring/20250416162802.3614051-1-kbusch@meta.com/
> [2] https://lore.kernel.org/all/20250527104237.2928-1-anuj20.g@samsung.com/

That makes sense, thanks for clarifying.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ