public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Patrick J. LoPresti" <patl@curl.com>
To: xystrus@haxm.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: link() security
Date: 15 Apr 2002 10:44:30 -0400	[thread overview]
Message-ID: <s5gpu11rpgx.fsf@egghead.curl.com> (raw)
In-Reply-To: <20020411192122.F5777@pizzashack.org>

xystrus <xystrus@haxm.com> writes:

> Many linux systems, like Slackware and SuSE, favor the permissions
> 1777 for the mail spool directory.  This is a good policy from a
> security perspective, as it prevents mail utilities from requiring
> SUID/SGID root or mail privileges to create a user's spool and/or lock
> files.

Actually, that is a horrible policy from a security perspective.  The
shared mail spool itself is a poor design and always has been.

A better design is to use a separate spool directory for each user
(/var/spool/mail/user/ or ~user/mail/ or somesuch), and only allow
that user to access it at all.  This solves *all* of the security
problems you mention:

   *) It avoids attacks based on race conditions, because you cannot
      create files in somebody else's spool.

   *) Admins can manage space with quotas or partitions just like they
      do for user home directories (i.e., it is a solved problem).

   *) You cannot link() to somebody else's spool file because you
      cannot even read the directory in which it resides.

The solution to a fundamentally broken spool design is to fix that
design, not to patch the kernel in nonstandard ways to plug just one
of its multiple flaws.

And yes, there are MTAs which use a directory per user by default.
Fix your MTA, do not hack the kernel.

All just My Opinion, of course.

 - Pat

  parent reply	other threads:[~2002-04-15 14:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-11 23:21 link() security xystrus
2002-04-12  1:15 ` Chris Wright
2002-04-13 16:59   ` Alan Cox
2002-04-13 17:02     ` xystrus
2002-04-14  1:49     ` Chris Wright
2002-04-15 14:44 ` Patrick J. LoPresti [this message]
2002-04-15 19:25   ` H. Peter Anvin
2002-04-15 22:48     ` Alan Cox
2002-04-15 23:05       ` H. Peter Anvin
2002-04-15 23:28         ` Alan Cox
2002-04-15 23:14           ` H. Peter Anvin
2002-04-16  0:01             ` Kurt Wall
2002-04-15 21:41   ` xystrus
2002-05-06  5:00     ` Albert D. Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2002-04-13 17:48 Hank Leininger
2002-04-15 19:36 Chris Adams
2002-04-15 19:55 ` H. Peter Anvin
2002-04-15 20:36   ` Patrick J. LoPresti
2002-04-16  1:37     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5gpu11rpgx.fsf@egghead.curl.com \
    --to=patl@curl.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xystrus@haxm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox