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]
Date:	Mon, 18 Aug 2014 18:53:08 +0200 (CEST)
From:	Fabian Frederick <fabf@...net.be>
To:	Zach Brown <zab@...bo.net>
Cc:	linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org
Subject: Re: [PATCH 1/1] Btrfs: fix sparse warning



> On 05 August 2014 at 23:32 Zach Brown <zab@...bo.net> wrote:
>
>
> > > > Hello Zach,
> > > >
> > > >     Here's an untested patch which
> > >
> > > Try testing it.  It's easy with virtualization and xfstests.
> > >
> > > You'll find that sending to a file fails because each individual file
> > > write call that makes up a send starts at offset 0 -- at the start of
> > > the file.
> > >
> > > Getting this right means getting the semantics around updating the send
> > > descriptors f_pos right.  It requires having a bit of a think about send
> > > semantics and f_pos update locking.
> >
> > Thanks for those informations Zach,
> >
> > I've tried btrfs test scripts related to ioctl in xfstests (tests/btrfs/025,
> > 035, 052, 055)
> > but was not able to trigger that problem. Do I have to create another
> > script,
> > use some generic one
> > or maybe use big test/scratch devices ?
>
> No idea, sorry.  Maybe your patch is fine and I'm a dummy.  Maybe you
> didn't test the kernel you thought you were testing.  Maybe the test
> doesn't test what you changed.  You'll have to do some investigating to
> find out.

After checking both kernel and btrfs-progs, it seems file offset is only being
passed through TLV(see send.c/ send_write/
TLV_PUT_U64(BTRFS_SEND_A_FILE_OFFSET). Tell me if I'm wrong but when we do
'btrfs send backup  | btrfs receive backupvolume',
btrfs-progs calls btrfs_ioctl_send emitting several BTRFS_SEND_C_WRITE with
relevant BTRFS_SEND_A_FILE_OFFSET (growing by 48kb). At the other side of | ,
'btrfs receive' executes read_and_process_cmd which does TLV_GET before
s->ops->write. All btrfs interactions being done with | maybe we could simply
replace vfs_write stuff as you suggested and remove sctx->send_off ?

Regards,
Fabian 

>
> - z
--
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