* UML/man: BLKGETSIZE takes a long, not an int
@ 2007-08-13 12:42 Nicolas George
2007-08-15 17:12 ` Jeff Dike
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas George @ 2007-08-13 12:42 UTC (permalink / raw)
To: linux-kernel, uml-devel
[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]
Hi.
I found a type mismatch in UML that makes host block devices unusable as ubd
devices on x86_64 and other 64 bits systems (segfault of the mm subsystem):
In block/ioctl.c, the following lines show that the BLKGETSIZE ioctl expects
a pointer to a long:
case BLKGETSIZE:
if ((bdev->bd_inode->i_size >> 9) > ~0UL)
return -EFBIG;
return put_ulong(arg, bdev->bd_inode->i_size >> 9);
In arch/um/os-Linux/file.c, os_file_size calls it with an int.
The ioctl_list man page should be fixed as well.
Regards,
--
Nicolas George
[-- Attachment #1.2: linux-umlblkgetsize-20070813.diff --]
[-- Type: text/x-diff, Size: 397 bytes --]
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 6f92f73..c3ecc2a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -320,7 +320,8 @@ int os_file_size(char *file, unsigned long long *size_out)
}
if(S_ISBLK(buf.ust_mode)){
- int fd, blocks;
+ int fd;
+ long blocks;
fd = os_open_file(file, of_read(OPENFLAGS()), 0);
if(fd < 0){
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: UML/man: BLKGETSIZE takes a long, not an int
2007-08-13 12:42 UML/man: BLKGETSIZE takes a long, not an int Nicolas George
@ 2007-08-15 17:12 ` Jeff Dike
2007-08-15 21:38 ` Nicolas George
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Dike @ 2007-08-15 17:12 UTC (permalink / raw)
To: Nicolas George; +Cc: linux-kernel, uml-devel
On Mon, Aug 13, 2007 at 02:42:47PM +0200, Nicolas George wrote:
> I found a type mismatch in UML that makes host block devices unusable as ubd
> devices on x86_64 and other 64 bits systems (segfault of the mm subsystem):
Looks sane, can I have a properly Signed-off-by: version of the patch?
Jeff
--
Work email - jdike at linux dot intel dot com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [uml-devel] [PATCH] UML: BLKGETSIZE takes a long, not an int
2007-08-15 17:12 ` Jeff Dike
@ 2007-08-15 21:38 ` Nicolas George
0 siblings, 0 replies; 7+ messages in thread
From: Nicolas George @ 2007-08-15 21:38 UTC (permalink / raw)
To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel
The BLKGETSIZE ioctl expects a pointer to a long, os_file_size was providing
an int. Therefore, ubd access to host block devices caused a segmentation
fault on 64 bits systems.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
---
Jeff Dike wrote:
> Looks sane, can I have a properly Signed-off-by: version of the patch?
Of course. I should have sent it correctly the first time. And I am terribly
sorry for the mess my mailer have done with my second mail.
Here is the hopefully correct patch, against current git.
Regards.
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 6f92f73..c3ecc2a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -320,7 +320,8 @@ int os_file_size(char *file, unsigned long long *size_out)
}
if(S_ISBLK(buf.ust_mode)){
- int fd, blocks;
+ int fd;
+ long blocks;
fd = os_open_file(file, of_read(OPENFLAGS()), 0);
if(fd < 0){
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH] UML: BLKGETSIZE takes a long, not an int
@ 2007-08-15 21:38 ` Nicolas George
0 siblings, 0 replies; 7+ messages in thread
From: Nicolas George @ 2007-08-15 21:38 UTC (permalink / raw)
To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel
The BLKGETSIZE ioctl expects a pointer to a long, os_file_size was providing
an int. Therefore, ubd access to host block devices caused a segmentation
fault on 64 bits systems.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
---
Jeff Dike wrote:
> Looks sane, can I have a properly Signed-off-by: version of the patch?
Of course. I should have sent it correctly the first time. And I am terribly
sorry for the mess my mailer have done with my second mail.
Here is the hopefully correct patch, against current git.
Regards.
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 6f92f73..c3ecc2a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -320,7 +320,8 @@ int os_file_size(char *file, unsigned long long *size_out)
}
if(S_ISBLK(buf.ust_mode)){
- int fd, blocks;
+ int fd;
+ long blocks;
fd = os_open_file(file, of_read(OPENFLAGS()), 0);
if(fd < 0){
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [uml-devel] [PATCH] UML: BLKGETSIZE takes a long, not an int
2007-08-15 21:38 ` Nicolas George
@ 2007-08-16 14:48 ` Jeff Dike
-1 siblings, 0 replies; 7+ messages in thread
From: Jeff Dike @ 2007-08-16 14:48 UTC (permalink / raw)
To: Nicolas George; +Cc: linux-kernel, user-mode-linux-devel
On Wed, Aug 15, 2007 at 11:38:25PM +0200, Nicolas George wrote:
> Here is the hopefully correct patch, against current git.
Thanks, I'll forward it upstream.
Jeff
--
Work email - jdike at linux dot intel dot com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* (no subject)
@ 2007-08-14 9:29 Nicolas George
2007-08-27 13:25 ` UML/man: BLKGETSIZE takes a long, not an int Michael Kerrisk
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas George @ 2007-08-14 9:29 UTC (permalink / raw)
To: linux-kernel, user-mode-linux-devel, jdike, mtk-manpages
[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]
Cc:
Bcc:
Subject: Re: UML/man: BLKGETSIZE takes a long, not an int
Reply-To:
In-Reply-To: <20070813124247.GA7414@she-seel.salle-s.org>
Hi.
I fear that my bug-report yesterday was very badly written, with me writing
to the wrong mailing-list and all.
I was saying:
> I found a type mismatch in UML that makes host block devices unusable as ubd
> devices on x86_64 and other 64 bits systems (segfault of the mm subsystem):
>
> In block/ioctl.c, the following lines show that the BLKGETSIZE ioctl expects
> a pointer to a long:
>
> case BLKGETSIZE:
> if ((bdev->bd_inode->i_size >> 9) > ~0UL)
> return -EFBIG;
> return put_ulong(arg, bdev->bd_inode->i_size >> 9);
>
> In arch/um/os-Linux/file.c, os_file_size calls it with an int.
>
> The ioctl_list man page should be fixed as well.
I add that the bug was still there yesterday in the git repository.
I join the patch to file.c.
Regards,
--
Nicolas George
[-- Attachment #1.2: linux-umlblkgetsize-20070813.diff --]
[-- Type: text/plain, Size: 397 bytes --]
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 6f92f73..c3ecc2a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -320,7 +320,8 @@ int os_file_size(char *file, unsigned long long *size_out)
}
if(S_ISBLK(buf.ust_mode)){
- int fd, blocks;
+ int fd;
+ long blocks;
fd = os_open_file(file, of_read(OPENFLAGS()), 0);
if(fd < 0){
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 185 bytes --]
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: UML/man: BLKGETSIZE takes a long, not an int
2007-08-14 9:29 Nicolas George
@ 2007-08-27 13:25 ` Michael Kerrisk
0 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk @ 2007-08-27 13:25 UTC (permalink / raw)
To: Nicolas George; +Cc: linux-kernel, user-mode-linux-devel, jdike
Hello Nicolas,
> I fear that my bug-report yesterday was very badly written, with me writing
> to the wrong mailing-list and all.
>
> I was saying:
>
>> I found a type mismatch in UML that makes host block devices unusable as ubd
>> devices on x86_64 and other 64 bits systems (segfault of the mm subsystem):
>>
>> In block/ioctl.c, the following lines show that the BLKGETSIZE ioctl expects
>> a pointer to a long:
>>
>> case BLKGETSIZE:
>> if ((bdev->bd_inode->i_size >> 9) > ~0UL)
>> return -EFBIG;
>> return put_ulong(arg, bdev->bd_inode->i_size >> 9);
>>
>> In arch/um/os-Linux/file.c, os_file_size calls it with an int.
>>
>> The ioctl_list man page should be fixed as well.
manual page changed for 2.65:
--- ioctl_list.2
+++ ioctl_list.2 (working copy)
@@ -243,7 +243,7 @@
0x0000125D BLKROSET const int *
0x0000125E BLKROGET int *
0x0000125F BLKRRPART void
-0x00001260 BLKGETSIZE int *
+0x00001260 BLKGETSIZE unsigned long *
0x00001261 BLKFLSBUF void
0x00001262 BLKRASET int
0x00001263 BLKRAGET int *
Thanks,
Michael
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-27 13:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13 12:42 UML/man: BLKGETSIZE takes a long, not an int Nicolas George
2007-08-15 17:12 ` Jeff Dike
2007-08-15 21:38 ` [uml-devel] [PATCH] UML: " Nicolas George
2007-08-15 21:38 ` Nicolas George
2007-08-16 14:48 ` [uml-devel] " Jeff Dike
2007-08-16 14:48 ` Jeff Dike
-- strict thread matches above, loose matches on Subject: below --
2007-08-14 9:29 Nicolas George
2007-08-27 13:25 ` UML/man: BLKGETSIZE takes a long, not an int Michael Kerrisk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.