The Service Engine crashes (SIGSEGV) when an HTTP Response Policy rule targets the 'Cache-Control' or 'Set-Cookie' headers
search cancel

The Service Engine crashes (SIGSEGV) when an HTTP Response Policy rule targets the 'Cache-Control' or 'Set-Cookie' headers

book

Article ID: 437356

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

  • The Service Engine (SE) may crash with a SIGSEGV when processing HTTP Response Policy rules that match on the 'Cache-Control' or 'Set-Cookie' response headers.
  • This issue occurs when a Response Policy rule is configured with a match condition targeting either of these headers.
  • The issue is specific to HTTP Response Policy rules. The same match conditions are processed correctly when configured in HTTP Request Policy rules and do not trigger the crash.
  • A Stack trace similar to the one below can be seen under "Administration -> Support -> Crash reports -> core_archive.<timestamp>.tar.gz"

 

Environment

  • VMware Avi Load Balancer
  • Affected Versions:
    • 22.x
    • 30.x
    • 31.x
    • 32.1.1

Cause

  • An issue in the HTTP Response Policy processing path causes improper handling of response policy rules configured to match the Cache-Control or Set-Cookie headers.
  • When the SE evaluates a Response Policy rule containing these header matches, the incorrect processing can lead to a segmentation fault (SIGSEGV) and cause the Service Engine process to terminate unexpectedly.

Resolution

  • Upgrade to version 32.1.2 to prevent Service Engine crashes triggered by HTTP Response Policy rules matching the Cache-Control or Set-Cookie headers.
  • AV-271477:The Service Engine crashes (SIGSEGV) when an HTTP Response Policy rule targets the Cache-Control or Set-Cookie Headers. Please refer the release notes here
  • Workaround: Use DataScript as a workaround instead of a Response Policy rules to match for these headers.
    • Below is an example datascript that matches the requested URL path for "/abcd" and matches a specific value for the 'Cache-Control' header and replaces the header with a new value
      1. Navigate to Templates > Scripts > DataScripts and click on "Create"
      2. Enter a name for the script then under "HTTP Events" click on "ADD" select "HTTP Response". Copy/Paste the script and save
      3. Navigate to the virtual service and edit (pencil) go to the policies tab and select datascripts and click on "Add Datascript".  Select the datascript object you created and save.
local path = avi.http.get_path()
if string.find(path, "^/abcd") then
  local cc = avi.http.get_header("Cache-Control")
  if cc and string.lower(cc) == "private, max-age=3600, no-transform" then
      avi.http.replace_header("Cache-Control",
          "private, max-age=7776000, no-transform, must-revalidate")
  end
end 
  • The datascript can be modified based on the requirement. For more information related to datascript, please refer the document Datascript

Additional Information