lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49FEC98E.4050906@msgid.tls.msk.ru>
Date:	Mon, 04 May 2009 14:55:10 +0400
From:	Michael Tokarev <mjt@....msk.ru>
To:	Andi Kleen <andi@...stfloor.org>
CC:	Linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: compat ioctl32 for /dev/snapshot?

Andi Kleen wrote:
> Michael Tokarev <mjt@....msk.ru> writes:
> 
>> Is there any reason why 32-bit uswsusp &Friends does not work
>> on 64bits kernel?
>>
>> For one, 32bits s2disk produces the following when trying to
>> suspend:
>>
>>  ioctl32(s2disk:4134): Unknown cmd fd(4) cmd(400c330d){t:'3';sz:12} arg(ff853554) on /dev/snapshot
>>  ioctl32(s2disk:4134): Unknown cmd fd(4) cmd(4004330a){t:'3';sz:4} arg(00000805) on /dev/snapshot
>>
[]
> It's probably just that nobody has written the code yet. In general all
> missing compat_ioctls are bugs.

Oh well.

Is the following patch ok?  I just pulled all the SNAPSHOT_* stuff from
include/linux/suspend_ioctls.h and added them into fs/compat_ioctl.c.
The ioctls are:
  o argument-less (most of them are)
  o have single loff_t argument (other ioctls with the same argument are
    marked as COMPAT_IOCTL
  o have single int argument - they's also marked as COMPAT_IOCTL,
  o and one othem, SNAPSHOT_SET_SWAP_AREA, has argument pointing to
    the following structure (include/linux/suspend_ioctls.h):
     struct resume_swap_area {
         loff_t offset;
         u_int32_t dev;
     } __attribute__((packed));
    so I think it also does not need any translation layer.

I can't test it so far, because uswsusp tools are broken in mixed
32/64bit case in other places.  But at least it compiles fine and
does not complain anymore.

I never touched this area before so I may be wrong... but if it's ok...

Signed-Off-By: Michael Tokarev <mjt@....msk.ru>

Thanks!

/mjt

View attachment "snapshot-compat-ioctl.patch" of type "text/x-patch" (1001 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ