lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428468410-12793-1-git-send-email-dccitaliano@gmail.com>
Date:	Tue,  7 Apr 2015 21:46:49 -0700
From:	Davide Italiano <dccitaliano@...il.com>
To:	linux-ext4@...r.kernel.org
Cc:	Davide Italiano <dccitaliano@...il.com>
Subject: [PATCH] ext4: move check under lock to avoid race

I originally thought that ext4_zero_range() and ext4_collapse() range
duplicated the check in fallocate(), performing it under the lock.
Dmitry explained to me how I was wrong, because there's nothing to
prevent ioctl() to convert indirect <==> extent, so the check needs to
be done with the inode lock held.
Further inspection showed that ext4_fallocate() doesn't re-check inside
the lock scope so I'm not entirely sure it's safe. 
I propose this patch that moves the check inside the lock scope to
guarantee safeness. My original point remains, i.e. there's no need to
duplicate it, in particular if there's nothing that prevents things to
change.
I hope this (take two) is slightly more correct.

Davide Italiano (1):
  ext4: Move check under lock scope to close a race.

 fs/ext4/extents.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

-- 
2.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ