Project

General

Profile

Actions

Bug #19371

closed

monitor creation with IPv6 public network segfaults

Added by Fabian Grünbichler about 7 years ago. Updated over 6 years ago.


Description

steps to reproduce:

1.) setup host using IPv6
2.) configure cluster and public network with IPv6 subnets in ceph.conf
3.) attempt to create a monitor
4.) ceph-mon --mkfs ... segfaults

the problematic code has been commited in 2011 before v0.39 - I haven't actually verified whether it is triggered that far back. it definitely triggers a segfault on Ceph Luminous (12.0.0)

the root cause is declaring a "struct sockaddr" in src/common/pick_address.cc find_ip_in_subnet_list, which is then first passed to parse_network and then to find_ip_in_subnet (both in src/common/ipaddr.cc). find_ip_in_subnet then casts the reference to sockaddr to one to sockaddr_in6 and assigns the IPv6 address. unfortunately, sockaddr is only 16 bytes big, so this assignment overwrites stuff on the stack.

note that the test cases don't catch this, as they only pass bigger structs casted to (sockaddr *) to parse_networks and find_ip_in_subnet when testing IPv6.

pull request will follow


Related issues 3 (0 open3 closed)

Copied to Ceph - Backport #19463: hammer: monitor creation with IPv6 public network segfaultsRejectedActions
Copied to Ceph - Backport #19464: jewel: monitor creation with IPv6 public network segfaultsResolvedShinobu KinjoActions
Copied to Ceph - Backport #19465: kraken: monitor creation with IPv6 public network segfaultsResolvedShinobu KinjoActions
Actions #2

Updated by Kefu Chai about 7 years ago

  • Status changed from New to Fix Under Review
  • Assignee set to Fabian Grünbichler
Actions #3

Updated by Kefu Chai about 7 years ago

  • Backport set to hammer, jewel, kraken
Actions #4

Updated by Kefu Chai about 7 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #5

Updated by Nathan Cutler about 7 years ago

  • Copied to Backport #19463: hammer: monitor creation with IPv6 public network segfaults added
Actions #6

Updated by Nathan Cutler about 7 years ago

  • Copied to Backport #19464: jewel: monitor creation with IPv6 public network segfaults added
Actions #7

Updated by Nathan Cutler about 7 years ago

  • Copied to Backport #19465: kraken: monitor creation with IPv6 public network segfaults added
Actions #8

Updated by Nathan Cutler over 6 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF