Skip to contentSkip to conversation

recvfrom01: Fix invalid flags in testcase 4

PATCH In review Chuck Ebbert 2 participants 2 messages Sep 25, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 recvfrom01: Fix invalid flags in testcase 4

The recv testcases had reported failures on 3.17-rc. [1]

Three of those failures were invalid assumptions about kernel behavior with every possible flag set. [2]

The fourth failure is because recfrom01 testcase 4 has invalid message flags in addition to its invalid address length, making it equivalent to test 6 (because the flags get checked first).

Remove the invalid flags, and change the text so it's more clear what is being tested.

Also fix indentation that made it harder to spot this bug.

Version 2: Add better text and remove an erroneous change to the buffer length spotted by Jan Stancek.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1145325
[2] http://marc.info/?t=141148149900006&r=1&w=2

testcases/kernel/syscalls/recvfrom/recvfrom01.c +3 -3
@@ -105,9 +105,9 @@
 		    0, ENOTSOCK, setup1, cleanup1, "invalid socket buffer"},
 /* 4 */
 	{
-	PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), -1,
+	PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), 0,
 		    (struct sockaddr *)&from, &fromlen,
-		    -1, EINVAL, setup2, cleanup1, "invalid socket length"},
+		    -1, EINVAL, setup2, cleanup1, "invalid socket addr length"},
 /* 5 */
 	{
 	PF_INET, SOCK_STREAM, 0, (void *)-1, sizeof(buf), 0,
@@ -115,7 +115,7 @@
 		    -1, EFAULT, setup1, cleanup1, "invalid recv buffer"},
 /* 6 */
 	{
-PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), -1,
+	PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), -1,
 		    (struct sockaddr *)&from, &fromlen,
 		    -1, EINVAL, setup1, cleanup1, "invalid flags set"},};
 

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

----- Original Message -----

Quoted 20 lines

From: "Chuck Ebbert" <[email protected]>
To: [email protected]
Cc: "Jan Stancek" <[email protected]>
Sent: Thursday, 25 September, 2014 1:58:38 PM
Subject: [PATCH V2] recvfrom01: Fix invalid flags in testcase 4

The recv testcases had reported failures on 3.17-rc. [1]

Three of those failures were invalid assumptions about kernel behavior with every possible flag set. [2]

The fourth failure is because recfrom01 testcase 4 has invalid message flags in addition to its invalid address length, making it equivalent to test 6 (because the flags get checked first).

Remove the invalid flags, and change the text so it's more clear what is being tested.

Also fix indentation that made it harder to spot this bug.

Quoted 7 lines

Version 2: Add better text and remove an erroneous change to the buffer length spotted by Jan Stancek.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1145325
[2] http://marc.info/?t=141148149900006&r=1&w=2

I tested and pushed this.

Regards,
Jan

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list