Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 635537 - Disable lseek(2) for virtio ports
Disable lseek(2) for virtio ports
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: 6.1
Assigned To: Amit Shah
Virtualization Bugs
:
Depends On:
Blocks: 580954
  Show dependency treegraph
 
Reported: 2010-09-20 02:09 EDT by Amit Shah
Modified: 2013-01-09 18:10 EST (History)
6 users (show)

See Also:
Fixed In Version: kernel-2.6.32-85.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-23 16:52:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0542 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 6.1 kernel security, bug fix and enhancement update 2011-05-19 07:58:07 EDT

  None (edit)
Description Amit Shah 2010-09-20 02:09:07 EDT
Description of problem:

virtio ports are not capable of being seeked, being char devices.  Disable the lseek(2) call.

After applying this patch, the lseek(2) call should return -ESPIPE.
Comment 3 RHEL Product and Program Management 2010-10-04 21:51:24 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.
Comment 5 Amit Shah 2010-10-13 01:30:58 EDT
To test:

W/o the patch, lseek in the guest should return a non-error code without having any effect on the chardev.

With this patch, lseek will return -ESPIPE.
Comment 6 Aristeu Rozanski 2010-12-13 10:14:38 EST
Patch(es) available on kernel-2.6.32-89.el6
Comment 8 juzhang 2011-01-13 07:02:07 EST
Reproduced on kernel-2.6.32-83.el6 using amit test-virtserial.git.

Step
1.get code form http://fedorapeople.org/gitweb?p=amitshah/public_git/test-virtserial.git;a=summary
  #git://fedorapeople.org/home/fedora/amitshah/public_git/test-virtserial.git
2.slightly modify
3./run-test.sh
file=/home/rhel6.0_64.qcow2,if=none,id=test,boot=on,cache=none,format=qcow2,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -vnc :1 -net none -enable-kvm -m 1G -serial file:/tmp/amit/test-serial.log -monitor unix:/tmp/amit/test-monitor,server,nowait -snapshot -smp 2
Guest is up 1
          test_open_close -  enabled (      open): PASS
          test_open_close -  enabled (     close): PASS
       test_multiple_open -  enabled (  multiple): PASS
      test_sysfs_and_udev -  enabled (      udev): PASS
   test_read_without_host -  enabled (      read): PASS
       test_blocking_read -  enabled (      read): PASS
    test_nonblocking_read -  enabled (      read): PASS
                test_poll -  enabled (   POLLHUP): PASS
                test_poll -  enabled (   POLLOUT): PASS
                test_poll -  enabled (    POLLIN): PASS
                test_lseek -  enabled (     lseek): FAIL  (Expected result: = -29, received result: 20)

Verified on kernel-2.6.32-95.el6 using the same steps
#./run-test.sh
/usr/libexec/qemu-kvm -drive file=/home/rhel6.0_64.qcow2,if=none,id=test,boot=on,cache=none,format=qcow2,werror=stop,rerror=stop -device virtio-blk-pci,drive=test -chardev socket,path=/tmp/amit/test0,server,nowait,id=test0 -chardev socket,path=/tmp/amit/test1,server,nowait,id=test1 -chardev socket,path=/tmp/amit/test2,server,nowait,id=test2 -chardev socket,path=/tmp/amit/test3,server,nowait,id=test3 -chardev socket,path=/tmp/amit/test4,server,nowait,id=test4 -device virtio-serial -device virtconsole,chardev=test0,name=console.0 -device virtserialport,chardev=test1,name=test1 -device virtserialport,chardev=test2,name=test2 -device virtserialport,chardev=test3,name=test3 -device virtserialport,chardev=test4,name=test4 -vnc :1 -net none -enable-kvm -m 1G -serial file:/tmp/amit/test-serial.log -monitor unix:/tmp/amit/test-monitor,server,nowait -snapshot -smp 2
Guest is up 1
          test_open_close -  enabled (      open): PASS
          test_open_close -  enabled (     close): PASS
       test_multiple_open -  enabled (  multiple): PASS
      test_sysfs_and_udev -  enabled (      udev): PASS
   test_read_without_host -  enabled (      read): PASS
       test_blocking_read -  enabled (      read): PASS
    test_nonblocking_read -  enabled (      read): PASS
                test_poll -  enabled (   POLLHUP): PASS
                test_poll -  enabled (   POLLOUT): PASS
                test_poll -  enabled (    POLLIN): PASS
               test_lseek -  enabled (     lseek): PASS

Please note,test_lseek is pass,that's means no means return in -ESPIPE.
Comment 10 juzhang 2011-01-17 21:50:05 EST
According to comment8,set this issue status as verified.
Comment 11 errata-xmlrpc 2011-05-23 16:52:51 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0542.html

Note You need to log in before you can comment on or make changes to this bug.