[LU-2302] Increase lfs_migrate robustness Created: 08/Nov/12  Updated: 28/Oct/13  Resolved: 28/Oct/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.0
Fix Version/s: Lustre 2.4.0

Type: Improvement Priority: Minor
Reporter: Daniel Kobras (Inactive) Assignee: Keith Mannthey (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Attachments: File lfs-migrate-locale.patch     File lfs-migrate-nullchar.patch     File lfs-migrate-sizeopt.patch     File lfs-migrate-umask.patch    
Rank (Obsolete): 5501

 Description   

The lfs_migrate utility suffers from a few robustness issues:

  • can temporarily leak information if used by root with a lenient umask;
  • fails if called with a non-English locale;
  • does not correctly handle newline characters in file/directory names;
  • is not compatible between 1.8 and 2.x Lustre versions.

I'll attach patches for all of the above right away. (Corporate firewall blocks access to Gerrit, so I cannot push them directly, unfortunately.)



 Comments   
Comment by Daniel Kobras (Inactive) [ 08/Nov/12 ]

prevent lfs_migrate data disclosure

Comment by Daniel Kobras (Inactive) [ 08/Nov/12 ]

fix lfs_migrate with non-English locale

Comment by Daniel Kobras (Inactive) [ 08/Nov/12 ]

null-terminated file lists in lfs_migrate

Comment by Daniel Kobras (Inactive) [ 08/Nov/12 ]

make lfs_migrate compatible with 1.8

Comment by Andreas Dilger [ 27/Nov/12 ]

Hi Daniel,
thanks for the patches. Sorry not to get back to you sooner. I saw the patches go through my inbox and thought someone else would take a look at them, but I guess that didn't happen. Someone will be importing them into Gerrit soon.

Comment by Keith Mannthey (Inactive) [ 28/Nov/12 ]

I ported the patches into git. lfs-migrate-nullchar.patch and lfs-migrate-sizeopt.patch had a little patch contextual issues that I worked out. I was not able to use "git am". Did you create the patches from "git format-patch" ?

http://review.whamcloud.com/4697 is: LU-2302 scripts: fix lfs_migrate with non-English locale (locale)
http://review.whamcloud.com/4700 is: LU-2302 scripts: null-terminated file lists in lfs_migrate (nullchar)
http://review.whamcloud.com/4702 is: LU-2302 scripts: make lfs_migrate compatible with 1.8 (sizeopt)
http://review.whamcloud.com/4699 is: LU-2302 scripts: prevent lfs_migrate data disclosure (umask)

Comment by Andreas Dilger [ 30/Nov/12 ]

Keith, please mark an inspection on these patches (even though you submitted them yourself) in Gerrit, since you didn't actually write them.

Comment by Keith Mannthey (Inactive) [ 04/Dec/12 ]

Daniel,
It seems http://review.whamcloud.com/4702 scripts: make lfs_migrate compatible with 1.8 (sizeopt) needs a little work.

If you submit a 2nd version of the patch I will be happy to put it into git for you.

Comment by Keith Mannthey (Inactive) [ 10/Jan/13 ]

While testing http://review.whamcloud.com/4702 an error may have been found in test:

https://maloo.whamcloud.com/test_sets/120d91a0-5b1a-11e2-8985-52540035b04c

== sanity test 56w: check lfs_migrate -c stripe_count works == 18:28:50 (1357784930)
/usr/bin/lfs_migrate -y -c 6 /mnt/lustre/d0.sanity/d56w/file1
/usr/bin/lfs_migrate: line 100: /bin: is a directory
 sanity test_56w: @@@@@@ FAIL: /usr/bin/lfs_migrate -y -c 6 /mnt/lustre/d0.sanity/d56w/file1 failed 

Where /usr/bin/lfs_migrate: line 100 is part of the code changed in the patch.

Comment by Daniel Kobras (Inactive) [ 14/Jan/13 ]

Keith, many thanks for taking care of the patches! I was out of office for several weeks but should be more responsive now. As for the test failure, I've added a note in Gerrit indicating the trivial fix. Could you please adjust the patch accordingly?

Comment by Jodi Levi (Inactive) [ 19/Apr/13 ]

With Change, 4702 landed can this ticket be closed, or is another patch needed?

Comment by Peter Jones [ 28/Oct/13 ]

It looks like this was landed for 2.4

Generated at Sat Feb 10 01:24:04 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.