Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Le 02/09/2020 à 15:13, David Laight a écrit :
From: Christoph Hellwig
Sent: 02 September 2020 13:37

On Wed, Sep 02, 2020 at 08:15:12AM +0200, Christophe Leroy wrote:
-		return 0;
-	return (size == 0 || size - 1 <= seg.seg - addr);
+	if (addr >= TASK_SIZE_MAX)
+		return false;
+	if (size == 0)
+		return false;

__access_ok() was returning true when size == 0 up to now. Any reason to
return false now ?

No, this is accidental and broken.  Can you re-run your benchmark with
this fixed?

Is TASK_SIZE_MASK defined such that you can do:

	return (addr | size) < TASK_SIZE_MAX) || !size;

TASK_SIZE_MAX will usually be 0xc0000000

With:
addr = 0x80000000;
size = 0x80000000;

I expect it to fail ....

With the formula you propose it will succeed, won't it ?

Christophe



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux