mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cantab.net>
To: Rolf Fokkens <fokkensr@linux06.vertis.nl>
Cc: "Thomas 'Dent' Mirlacher" <dent@cosy.sbg.ac.at>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] module locking
Date: Mon, 29 Apr 2002 16:03:18 +0100	[thread overview]
Message-ID: <5.1.0.14.2.20020429154159.04a13d80@pop.cus.cam.ac.uk> (raw)
In-Reply-To: <200204291430.g3TEUiV02444@fokkensr.vertis.nl>

At 08:30 29/04/02, Rolf Fokkens wrote:
>On Monday 29 April 2002 09:23, Thomas 'Dent' Mirlacher wrote:
> > the capable call is sthell there, but with the module_lock
> > kind or redundant.
>
>once set module_lock cannot be cleared, not even by root. This differs from
>the CAP_SYS_MODULE which can be activated by root, if I'm correct.
>
>module_lock is only a suggestion, w/o /dev/kmem write locking or even 
>locking writes on other /dev/.. or doing mounts it won't be full proof.

*sigh*

RTFM man 2 sysctl

With your patch applied AND module_lock set to 1, anyone with sufficient 
privileges could still do:

#include <linux/unistd.h>
#include <linux/types.h>
#include <linux/sysctl.h>

_syscall1(int, _sysctl, struct __sysctl_args *, args);
#define SIZE(x) sizeof(x)/sizeof(x[0])

int main(void)
{
         int name[] = { CTL_KERN, KERN_MODPROBE };
         int hack = 0;
         struct __sysctl_args args = { name, SIZE(name), 0, 0,
                         &hack, sizeof(hack) };

         if (_sysctl(&args)) {
                 perror("sysctl failed");
                 exit(1);
         }
         printf("module_lock has been zeroed! Muahaha!");
         return 0;
}

Good bye module_lock! /me waves

What was that about not being able to zero it again...?

Best regards,

Anton


-- 
   "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/


  reply	other threads:[~2002-04-29 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-29  7:11 Rolf Fokkens
2002-04-29  7:21 ` Thomas 'Dent' Mirlacher
2002-04-29  7:23 ` Thomas 'Dent' Mirlacher
2002-04-29  7:30   ` Rolf Fokkens
2002-04-29 15:03     ` Anton Altaparmakov [this message]
2002-04-29  8:22 ` Anton Altaparmakov

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=5.1.0.14.2.20020429154159.04a13d80@pop.cus.cam.ac.uk \
    --to=aia21@cantab.net \
    --cc=dent@cosy.sbg.ac.at \
    --cc=fokkensr@linux06.vertis.nl \
    --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

all inboxes | Powered by JetHome®