[LU-5365] invalid pool name accepted when setting stripe information Created: 17/Jul/14  Updated: 07/Jun/16

Status: In Progress
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Ned Bass Assignee: Jian Yu
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File pool_test.c    
Severity: 3
Rank (Obsolete): 14962

 Description   

When striping information is set for a file, the kernel will accept the name of an OST pool which does not exist. The lfs utility validates the pool name in user space, but this can be bypassed by using the ioctl() or fsetxattr() interfaces directly. See attached program.

$  bass6@t222 >
gcc -I lustre/include -I libcfs/include pool_test.c lustre/utils/liblustreapi.a
$  bass6@t222 >
sudo ./a.out /mnt/lustre/`mktemp -u XXXX` /mnt/lustre/`mktemp -u XXXX` asdf
a.out: poolname 'asdf' accepted via ioctl() for file /mnt/lustre/uchD
a.out: poolname 'asdf' accepted via fsetxattr() for file /mnt/lustre/Ba5t


 Comments   
Comment by Peter Jones [ 17/Jul/14 ]

Yu, Jian

Could you please assist with this issue?

Thanks

Peter

Comment by Andreas Dilger [ 17/Jul/14 ]

The current implementation on the MDS is that if a pool name doesn't exist, the file will be created in the default pool. This is to avoid problems creating files if e.g. a default striping is set on a directory with a specific pool but the pool is later removed. Rather than making the userspace validation more robust (which adds overhead and can always be defeated), it would be better to handle this differently on the MDS and return an error (e.g. -ENXIO or whatever) if the pool does not exist.

Comment by Jian Yu [ 25/Jul/14 ]

Patch for master branch: http://review.whamcloud.com/11226

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