Bug 1145325

Summary: 3.17 kernel recv functions return EAGAIN instead of EINVAL
Product: [Fedora] Fedora Reporter: Jeff Bastian <jbastian>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: cebbert.lkml, gansalmon, itamar, jonathan, jstancek, kernel-maint, madhu.chinakonda, mchehab
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1144510 Environment:
Last Closed: 2014-09-24 12:20:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix LTP recvfrom01 syscall test case 4 none

Description Jeff Bastian 2014-09-22 20:23:49 UTC
Description of problem:
LTP syscalls tests are failing on the 3.17 kernel because the tests expect EINVAL (errno=22), but instead they get EAGAIN (errno=11).  This is a new failure and regression compared to 3.16.

recv01      4  TFAIL  :  recv01.c:142: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)
recvfrom01    4  TFAIL  :  recvfrom01.c:164: invalid socket length ; returned -1 (expected -1), errno 11 (expected 22)
recvfrom01    6  TFAIL  :  recvfrom01.c:164: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)
recvmsg01    9  TFAIL  :  recvmsg01.c:228: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)


Version-Release number of selected component (if applicable):
kernel-3.17.0-0.rc5.git5.1.fc22.x86_64
LTP-20140828

How reproducible:
every time

Steps to Reproduce:
1. compile and run LTP-20140828 recv tests

# wget -c -O 'ltp-full-20140828.tar.bz2' 'http://superb-dca2.dl.sourceforge.net/project/ltp/LTP%20Source/ltp-20140828/ltp-full-20140828.tar.bz2'
# tar xjf ltp-full-20140828.tar.bz2
# cd ltp-full-20140828
# ./configure --prefix=/opt/ltp-20140828 && make && make install
# cd /opt/ltp-20140828/
# ./testcases/bin/recv01
# ./testcases/bin/recvfrom01
# ./testcases/bin/recvmsg01


Actual results:
recv tests report TFAIL results

Expected results:
recv tests report TPASS results

Additional info:
Output with 3.16 kernel:

# uname -r
3.16.2-201.fc20.x86_64
# ./testcases/bin/recv01
recv01      1  TPASS  :  bad file descriptor successful
recv01      2  TPASS  :  invalid socket successful
recv01      3  TPASS  :  invalid recv buffer successful
recv01      4  TPASS  :  invalid flags set successful
# ./testcases/bin/recvfrom01 
recvfrom01    1  TPASS  :  bad file descriptor successful
recvfrom01    2  TPASS  :  invalid socket successful
recvfrom01    3  TPASS  :  invalid socket buffer successful
recvfrom01    4  TPASS  :  invalid socket length successful
recvfrom01    5  TPASS  :  invalid recv buffer successful
recvfrom01    6  TPASS  :  invalid flags set successful
# ./testcases/bin/recvmsg01 
recvmsg01    1  TPASS  :  bad file descriptor successful
recvmsg01    2  TPASS  :  invalid socket successful
recvmsg01    3  TPASS  :  invalid socket buffer successful
recvmsg01    4  TPASS  :  invalid socket length successful
recvmsg01    5  TPASS  :  invalid recv buffer successful
recvmsg01    6  TPASS  :  invalid iovec buffer successful
recvmsg01    7  TPASS  :  invalid iovec count successful
recvmsg01    8  TPASS  :  rights reception successful
recvmsg01    9  TPASS  :  invalid flags set successful
recvmsg01   10  TPASS  :  invalid cmsg length successful
recvmsg01   11  TPASS  :  large cmesg length successful



Output with 3.17 kernel:

# uname -r
3.17.0-0.rc5.git5.1.fc22.x86_64
# ./testcases/bin/recv01
recv01      1  TPASS  :  bad file descriptor successful
recv01      2  TPASS  :  invalid socket successful
recv01      3  TPASS  :  invalid recv buffer successful
recv01      4  TFAIL  :  recv01.c:142: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)
# ./testcases/bin/recvfrom01 
recvfrom01    1  TPASS  :  bad file descriptor successful
recvfrom01    2  TPASS  :  invalid socket successful
recvfrom01    3  TPASS  :  invalid socket buffer successful
recvfrom01    4  TFAIL  :  recvfrom01.c:164: invalid socket length ; returned -1 (expected -1), errno 11 (expected 22)
recvfrom01    5  TPASS  :  invalid recv buffer successful
recvfrom01    6  TFAIL  :  recvfrom01.c:164: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)
# ./testcases/bin/recvmsg01 
recvmsg01    1  TPASS  :  bad file descriptor successful
recvmsg01    2  TPASS  :  invalid socket successful
recvmsg01    3  TPASS  :  invalid socket buffer successful
recvmsg01    4  TPASS  :  invalid socket length successful
recvmsg01    5  TPASS  :  invalid recv buffer successful
recvmsg01    6  TPASS  :  invalid iovec buffer successful
recvmsg01    7  TPASS  :  invalid iovec count successful
recvmsg01    8  TPASS  :  rights reception successful
recvmsg01    9  TFAIL  :  recvmsg01.c:228: invalid flags set ; returned -1 (expected -1), errno 11 (expected 22)
recvmsg01   10  TPASS  :  invalid cmsg length successful
recvmsg01   11  TPASS  :  large cmesg length successful

Comment 2 Chuck Ebbert 2014-09-23 16:21:02 UTC
LTP is broken:

http://marc.info/?t=141148149900006&r=1&w=2

Comment 3 Josh Boyer 2014-09-24 12:20:50 UTC
Yeah, I have to agree with Chuck here.  Thanks for bringing this to the attention of upstream Chuck.

Comment 4 Chuck Ebbert 2014-09-24 14:16:11 UTC
Created attachment 940788 [details]
Fix LTP recvfrom01 syscall test case 4

recvfrom01 testcase 4 had a different problem. I sent a patch to LTP, I'll attach it here too in case it doesn't get past moderation.