HomeClusterLabs Projects

Low: exportfs: check fsid parameter for not containing a comma

Description

Low: exportfs: check fsid parameter for not containing a comma

Otherwise, it would be possible to circumvent the handling logic in
multiple ways, at the very least:
a. inject new (and potentionally unchecked as in standard flow)

export options through fsid parameter

b. accidentally make sed expression intended to override

fsid option present in export options with explicitly
provided fsid invalid if this explicit input contains
a character finalizing the sed substutition command

c. allow for repeated fsid specification in the resulting

export options, possibly verging on undefined (implementation
specific) behavior, because of matching only numerical fsid
already existing in options

Because in standard Linux implementation of NFS exports, there
is no strict restriction on string reprezentation of UUID data
type[*], solution on the resource-agents' side is to enforce one

  • fsid parameter can now no longer contain a comma.

This should make us safe in both a. and b. And existing sed
expression is refined to tackle case c.

  • nfs-utils in fact only have these restrictions on UUID:
  • only hex characters do count (as in isxdigit(3))
  • there must be exactly 32 of them throughout the value, i.e., "punctuation" is an arbitrary byte X for which isxdigit(X) == 0

http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=utils/mountd/cache.c;hb=nfs-utils-1-3-5-rc3#l260
http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=support/nfs/exports.c;hb=nfs-utils-1-3-5-rc3#l391

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Nov 21 2016, 8:22 AM
Parents
rRdbf31c9c5b23: Merge pull request #886 from turchanov/ifcheck-must-not-suppress-stdout
Branches
Unknown
Tags
Unknown

Event Timeline