public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: russell@coker.com.au (Russell Coker)
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk
Subject: patch for open file handles with initrd in 2.4.20
Date: Wed, 22 Jan 2003 21:26:40 +0100	[thread overview]
Message-ID: <20030122202640.GA17661@coker.com.au> (raw)

The following patch was back-ported from 2.5.x by Stephen Smalley to fix a
problem where the file handle of the root of the initrd is inherited by init
and other processes.

The bug was discovered when running SE Linux on 2.4.20 systems with a policy
that denied such inheriting of file handles and logged the operations it
denied.

This patch has been well tested, please include it in 2.4.21.


--- linux-2.4.20.lsm-old/init/do_mounts.c	2002-12-13 19:33:23.000000000 +0100
+++ linux-2.4.20.lsm/init/do_mounts.c	2002-12-13 19:36:48.000000000 +0100
@@ -812,6 +812,8 @@
 	/* switch root and cwd back to / of rootfs */
 	sys_fchdir(root_fd);
 	sys_chroot(".");
+	close(old_fd);
+	close(root_fd);
 	sys_umount("/old/dev", 0);
 
 	if (real_root_dev == ram0) {

                 reply	other threads:[~2003-01-22 20:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030122202640.GA17661@coker.com.au \
    --to=russell@coker.com.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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