Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: tommy.christensen@eicon.com
To: Ralf Baechle <ralf@oss.sgi.com>
Cc: linux-mips@oss.sgi.com
Subject: Re: Register allocation in copy_to_user
Date: Thu, 4 Oct 2001 17:11:45 +0200	[thread overview]
Message-ID: <3BBC7C31.A452AD03@eicon.com> (raw)
In-Reply-To: 3BB0D217.80E313F5@eicon.com

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]


tommy.christensen@eicon.com wrote:
>
> Anyway, the attached patch solves this by explicitly building the
arguments
> to __copy_user in the argument registers ;-) instead of moving them
around.

This idea totally breaks, when the arguments (to copy_to_user) contain a
function call. We force the compiler to use a caller-saved register (like
a0)
across the function call. One place this happens is in net/ipv4/netfilter/
ip_tables.c/copy_entries_to_user().

The patch below fixes this, while preserving the original fix (for the tty
corruption). Although this is getting a little messy, the patch is not as
bad as it might seem. gcc will discard the extra temporary variables
(cu_to,
cu_from and cu_len) in far the most cases, and use them where necessary to
handle function calls.
Sorry, if this has caused any trouble.

-Tommy
(See attached file: uaccess.patch.gz)

[-- Attachment #2: uaccess.patch.gz --]
[-- Type: application/octet-stream, Size: 523 bytes --]

      parent reply	other threads:[~2001-10-04 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-25 18:51 Register allocation in copy_to_user tommy.christensen
2001-09-25 22:11 ` Ralf Baechle
2001-10-04 15:11 ` tommy.christensen [this message]

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=3BBC7C31.A452AD03@eicon.com \
    --to=tommy.christensen@eicon.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@oss.sgi.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