Skip to content

race condition in get_all #12

@ThomasWaldmann

Description

@ThomasWaldmann
  1. you first determine the size of the xattr list
  2. then you alloc a buffer of that size
  3. then you actually fetch the list into the buffer

if between 1 and 3 the xattr list changes in the filesystem, the call fails.

at other places in the code I've seen a while loop for such cases.

BTW, I was looking at your code because we just had such a race condition in our code, discovered in the wild, in practical use. (borgbackup has xattr code for linux, freebsd, osx).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions