Bug 1266247

Summary: [GSS](6.4.z) Http11NioProtocol + HTTPS fails to unwrap large requests even with acceptLargeFragments is true
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Robert Bost <rbost>
Component: WebAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hatlapatka <rhatlapa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: aogburn, bbaranow, bmaxwell, rmaucher, vcorrea
Target Milestone: CR1   
Target Release: EAP 6.4.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 1235745, 1269109, 1281401    
Attachments:
Description Flags
reproducer war. none

Description Robert Bost 2015-09-24 21:07:10 UTC
Description of problem: Experiencing BUFFER_OVERFLOW in JBoss when using NIO. Buffer is not expanded so request fails.


Version-Release number of selected component (if applicable): 6.4.0


How reproducible: Always, when using NIO and HTTPS.


Steps to Reproduce:
1. Use org.apache.coyote.http11.Http11NioProtocol and HTTPS
2. Make a request that has a packet size 16KB+ 
3. Check logs for "BWEB003064: Error during blocking read: java.io.IOException: JBWEB002048: Unable to unwrap data, invalid status 
BUFFER_OVERFLOW"

Actual results: Failure to process request, resulting in failed request 


Expected results: Expected request to succeed just as it would if not using NIO 


Additional info:

Issue happens even when using `-Djsse.SSLEngine.acceptLargeFragments=true`.

I'll attached the .war I used to reproduce.

16:26:50,774 DEBUG [org.apache.coyote.http11] (http-/127.0.0.1:8443-13) JBWEB003064: Error during blocking read: java.io.IOException: JBWEB002048: Unable to unwrap data, invalid status 
BUFFER_OVERFLOW
        at org.apache.tomcat.util.net.jsse.SecureNioChannel.unwrap(SecureNioChannel.java:591) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.tomcat.util.net.jsse.SecureNioChannel.readBytes(SecureNioChannel.java:134) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.InternalNioInputBuffer.fill0(InternalNioInputBuffer.java:515) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:469) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.InternalNioInputBuffer.parseRequestLine(InternalNioInputBuffer.java:316) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:290) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:911) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at org.apache.tomcat.util.net.NioEndpoint$ChannelProcessor.run(NioEndpoint.java:936) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]
        at org.apache.tomcat.util.net.NioEndpoint$DefaultThreadFactory$1$1.run(NioEndpoint.java:1249) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

Comment 1 Robert Bost 2015-09-24 21:08:42 UTC
Created attachment 1076723 [details]
reproducer war.

Comment 3 Robert Bost 2015-09-25 21:54:56 UTC
For what is it worth, using org.apache.coyote.http11.Http11AprProtocol, SSL, and WebSockets seems to work without issue. Issue only seems to be present in SSL related Nio code.

Comment 8 Rémy Maucherat 2015-10-02 13:22:24 UTC
r2629 in web.

Comment 11 Radim Hatlapatka 2015-11-03 13:12:12 UTC
Verified with EAP 6.4.5.CP.CR1.

Comment 13 Radim Hatlapatka 2015-11-09 15:13:59 UTC
*** Bug 1275403 has been marked as a duplicate of this bug. ***

Comment 14 Petr Penicka 2017-01-17 11:43:39 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 15 Petr Penicka 2017-01-17 11:43:59 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.