From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Miklos Szeredi" <miklos@szeredi.hu>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/7] fuse: add POSIX file locking support
Date: Mon, 19 Jun 2006 10:21:38 +0200 [thread overview]
Message-ID: <9a8748490606190121u3c76c6bbif707835ec7e5873c@mail.gmail.com> (raw)
In-Reply-To: <E1FplXk-00062M-00@dorka.pomaz.szeredi.hu>
On 12/06/06, Miklos Szeredi <miklos@szeredi.hu> wrote:
> This patch adds POSIX file locking support to the fuse interface.
>
> +/*
> + * It would be nice to scramble the ID space, so that the value of the
> + * files_struct pointer is not exposed to userspace. Symmetric crypto
> + * functions are overkill, since the inverse function doesn't need to
> + * be implemented (though it does have to exist). Is there something
> + * simpler?
> + */
> +static inline u64 fuse_lock_owner_id(fl_owner_t id)
> +{
> + return (unsigned long) id;
> +}
> +
How about; on fuse startup, pick some semirandom number, store it
somewhere, then do an XOR of the pointer with the saved value to
scramble it, when you need to use it, simply XOR it again with the
stored value... Not especially strong, but better than nothing and
better than just adding a constant that people can find out from the
source (and the scramble value would be differene each time fuse
loads, so at a minimum a different scramble key every boot) - also,
XOR is a quite fast operation so overhead should be low.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2006-06-19 8:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 12:21 [PATCH 0/7] fuse: file locking + misc Miklos Szeredi
2006-06-12 12:25 ` [PATCH 1/7] fuse: use MISC_MAJOR Miklos Szeredi
2006-06-12 12:27 ` [PATCH 2/7] fuse: no backgrounding on interrupt Miklos Szeredi
2006-06-12 12:28 ` [PATCH 3/7] fuse: add control filesystem Miklos Szeredi
2006-06-19 6:55 ` Andrew Morton
2006-06-19 8:06 ` Miklos Szeredi
2006-06-12 12:29 ` [PATCH 4/7] fuse: add POSIX file locking support Miklos Szeredi
2006-06-19 6:58 ` Andrew Morton
2006-06-19 8:12 ` Miklos Szeredi
2006-06-19 8:21 ` Jesper Juhl [this message]
2006-06-19 8:37 ` Miklos Szeredi
2006-06-19 9:04 ` Jesper Juhl
2006-06-19 9:10 ` Miklos Szeredi
2006-06-12 12:30 ` [PATCH 5/7] fuse: ensure FLUSH reaches userspace Miklos Szeredi
2006-06-12 12:31 ` [PATCH 6/7] fuse: rename the interrupted flag Miklos Szeredi
2006-06-12 12:33 ` [PATCH 7/7] fuse: add request interruption Miklos Szeredi
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=9a8748490606190121u3c76c6bbif707835ec7e5873c@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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;
as well as URLs for NNTP newsgroup(s).