Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 00/12] pull: race fixes
@ 2015-10-31 19:21 Sami Kerola
  2015-10-31 19:21 ` [PATCH 01/12] login: fix stat(2) race Sami Kerola
                   ` (13 more replies)
  0 siblings, 14 replies; 22+ messages in thread
From: Sami Kerola @ 2015-10-31 19:21 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Hello,

I had a look of all chmod(3), chown(3), and stat(3) calls in executables if
there are file operation, preceeded by open(3) in unsafe manner.  The
changes in this pull request attempsts to correct these TACTOU cases.

The pull request has also few improvements, such as checking block device
correct way when ever opening them to write in them and replacements stat(3)
with access(3) when applicable.


----------------------------------------------------------------
The following changes since commit 4419ffb9eff5801fdbd385a4a6199b3877f802ad:
  lib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust (2015-10-30 11:08:32 +0100)
are available in the git repository at:
  git://github.com/kerolasa/lelux-utiliteetit.git races
for you to fetch changes up to 09acbb45083e37f112f3d0558f4875f94db457d4:
  fdformat: fix block device open race (2015-10-31 19:00:09 +0000)
----------------------------------------------------------------

Sami Kerola (12):
  login: fix stat(2) race
  swapon: fix stat(3) and open(3) race
  fsck: retire stat(3) when access(3) does better job
  agetty: fix chown(3), chmod(3) and open(3) race
  script, hwclock: check file exist with access(3) rather than stat(3)
  lib/fileutils: add is_same_inode() check
  include/blkdev: add open_blkdev_or_file() function
  mkfs.bfs: fix block device open race
  mkfs.minix: fix block device open race
  mkswap: fix block device open race
  mesg: fix multiple races
  fdformat: fix block device open race

 disk-utils/fdformat.c   | 11 ++++-------
 disk-utils/fsck.c       |  3 +--
 disk-utils/mkfs.bfs.c   |  2 +-
 disk-utils/mkfs.minix.c |  9 +++------
 disk-utils/mkswap.c     | 25 ++++++++-----------------
 include/blkdev.h        |  3 +++
 include/fileutils.h     | 14 ++++++++++++++
 lib/blkdev.c            | 27 +++++++++++++++++++++++++++
 login-utils/login.c     |  6 ++----
 sys-utils/hwclock.c     |  5 +----
 sys-utils/swapon.c      | 14 +++++++-------
 term-utils/agetty.c     | 10 +++++-----
 term-utils/mesg.c       | 25 +++++++++++++++++--------
 term-utils/script.c     |  3 +--
 14 files changed, 94 insertions(+), 63 deletions(-)

-- 
2.6.2


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-12-02  9:54 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-31 19:21 [PATCH 00/12] pull: race fixes Sami Kerola
2015-10-31 19:21 ` [PATCH 01/12] login: fix stat(2) race Sami Kerola
2015-10-31 19:21 ` [PATCH 02/12] swapon: fix stat(3) and open(3) race Sami Kerola
2015-10-31 19:21 ` [PATCH 03/12] fsck: retire stat(3) when access(3) does better job Sami Kerola
2015-10-31 19:21 ` [PATCH 04/12] agetty: fix chown(3), chmod(3) and open(3) race Sami Kerola
2015-11-09  9:01   ` Karel Zak
2015-10-31 19:21 ` [PATCH 05/12] script, hwclock: check file exist with access(3) rather than stat(3) Sami Kerola
2015-11-09  8:43   ` Karel Zak
2015-10-31 19:21 ` [PATCH 06/12] lib/fileutils: add is_same_inode() check Sami Kerola
2015-11-09  8:54   ` Karel Zak
2015-10-31 19:21 ` [PATCH 07/12] include/blkdev: add open_blkdev_or_file() function Sami Kerola
2015-11-09  8:51   ` Karel Zak
2015-11-22 21:27     ` Sami Kerola
2015-10-31 19:21 ` [PATCH 08/12] mkfs.bfs: fix block device open race Sami Kerola
2015-11-09  8:48   ` Karel Zak
2015-11-22 21:24     ` Sami Kerola
2015-10-31 19:21 ` [PATCH 09/12] mkfs.minix: " Sami Kerola
2015-10-31 19:21 ` [PATCH 10/12] mkswap: " Sami Kerola
2015-10-31 19:21 ` [PATCH 11/12] mesg: fix multiple races Sami Kerola
2015-10-31 19:21 ` [PATCH 12/12] fdformat: fix block device open race Sami Kerola
2015-11-09  8:58 ` [PATCH 00/12] pull: race fixes Karel Zak
2015-12-02  9:54 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox