mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: "Jesper Juhl" <juhl-lkml@dif.dk>,
	"linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "Andrew Morton" <akpm@osdl.org>
Subject: RE: [PATCH][3/4] let's kill verify_area - convert kernel/compat.c to access_ok()
Date: Fri, 7 Jan 2005 11:02:15 +0100	[thread overview]
Message-ID: <50BF37ECE4954A4BA18C08D0C2CF88CB010400CA@exmail1.se.axis.com> (raw)

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Jesper Juhl
> Sent: Friday, January 07, 2005 02:19
> To: linux-kernel
> Cc: Andrew Morton
> Subject: [PATCH][3/4] let's kill verify_area - convert kernel/compat.c
to access_ok()
> 
> Here's a patch to convert verify_area to access_ok in kernel/compat.c
> 
> diff -up linux-2.6.10-bk9-orig/kernel/compat.c 
> linux-2.6.10-bk9/kernel/compat.c
> --- linux-2.6.10-bk9-orig/kernel/compat.c	2005-01-06
22:19:13.000000000 +0100
> +++ linux-2.6.10-bk9/kernel/compat.c	2005-01-07 02:06:00.000000000
+0100

[snip]

> @@ -612,7 +612,7 @@ long compat_get_bitmap(unsigned long *ma
>  	/* align bitmap up to nearest compat_long_t boundary */
>  	bitmap_size = ALIGN(bitmap_size, BITS_PER_COMPAT_LONG);
>  
> -	if (verify_area(VERIFY_READ, umask, bitmap_size / 8))
> +	if (!access_ok(VERIFY_READ, umask, bitmap_size / 8) != 0)

Please do not use double negations (i.e., drop the '!= 0' test 
again).

>  		return -EFAULT;
>  
>  	nr_compat_longs = BITS_TO_COMPAT_LONGS(bitmap_size);
> @@ -653,7 +653,7 @@ long compat_put_bitmap(compat_ulong_t __
>  	/* align bitmap up to nearest compat_long_t boundary */
>  	bitmap_size = ALIGN(bitmap_size, BITS_PER_COMPAT_LONG);
>  
> -	if (verify_area(VERIFY_WRITE, umask, bitmap_size / 8))
> +	if (!access_ok(VERIFY_WRITE, umask, bitmap_size / 8) != 0)
>  		return -EFAULT;
>  
>  	nr_compat_longs = BITS_TO_COMPAT_LONGS(bitmap_size);

//Peter

             reply	other threads:[~2005-01-07 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 10:02 Peter Kjellerstedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-07  1:18 Jesper Juhl
2005-01-07  1:58 ` Andries Brouwer

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=50BF37ECE4954A4BA18C08D0C2CF88CB010400CA@exmail1.se.axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=akpm@osdl.org \
    --cc=juhl-lkml@dif.dk \
    --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®