[LU-7187] Client does not sanitize jobstats variable Created: 18/Sep/15 Updated: 29/Oct/15 Resolved: 02/Oct/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0, Lustre 2.5.4 |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Improvement | Priority: | Critical |
| Reporter: | Jesse Hanley | Assignee: | Niu Yawei (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
RHEL 6.6 |
||
| Issue Links: |
|
||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
The Lustre client doesn't appear to sanitize the contents of the job stats variable. For example: [user@client test_dir]# export TESTINGVAR=$(echo -e "test\n\n\a\b\tstring"); touch example.file [user@mds1 ~]# lctl get_param -n mdt.*.job_stats
string close: { samples: 1, unit: reqs }mknod: { samples: 0, unit: reqs }link: { samples: 0, unit: reqs }unlink: { samples: 0, unit: reqs }mkdir: { samples: 0, unit: reqs }rmdir: { samples: 0, unit: reqs }rename: { samples: 0, unit: reqs }getattr: { samples: 0, unit: reqs }setattr: { samples: 1, unit: reqs }getxattr: { samples: 0, unit: reqs }setxattr: { samples: 0, unit: reqs }statfs: { samples: 0, unit: reqs }sync: { samples: 0, unit: reqs }samedir_rename: { samples: 0, unit: reqs }crossdir_rename: { samples: 0, unit: reqs }This also produces an audible bell (the \a). I wouldn't say this is a bug, but it is probably unintended behavior. It's definitely reproducible. I've tested with some various escape codes. Probably my favorite thus far has been setting color codes. Thanks, |
| Comments |
| Comment by Andreas Dilger [ 18/Sep/15 ] |
|
Probably the best/easiest thing to do is filter this at both the input and output of the jobid to use isprint() and replace non-printing characters with '.' or similar. At worst this could allow some collisions in the jobid statistics. |
| Comment by Niu Yawei (Inactive) [ 21/Sep/15 ] |
|
I don't think it's a bug, given that non-printable character is allowed in the jobid environment variable. |
| Comment by Oleg Drokin [ 21/Sep/15 ] |
|
Niu, I agree it's not strictly Lustre bug. But we might be a bit more proactive lookign for user's good here and still filter out unprintable characters anyway at least on the output. |
| Comment by Niu Yawei (Inactive) [ 22/Sep/15 ] |
Sure, I think we can replace the non-printable character with some special character like '?' on the output side, so that to confine the output of jobid in single line. |
| Comment by Gerrit Updater [ 22/Sep/15 ] |
|
Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/16593 |
| Comment by Gerrit Updater [ 02/Oct/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16593/ |
| Comment by Joseph Gmitter (Inactive) [ 02/Oct/15 ] |
|
Landed for 2.8.0 |