Skip to content

Commit 990354b

Browse files
Fix bug in disable_ptrace action to allow sysctl to disable ptrace. (#2313)
Previously the setting for Ubuntu systems was not getting used due to a misalignment between the cookbook and cli. On the cli, node['cluster']['enable_efa'] was set to 'efa' in the dna.json file, but the cookbook assumed the parameter was set to 'compute'. This causes the disable_ptrace action if clause to be skipped. This page describes the use of sysctl https://manpages.ubuntu.com/manpages/bionic/man5/sysctl.conf.5.html This page describes the function of the ptrace_scope parameter https://www.kernel.org/doc/Documentation/security/Yama.txt Chef actually generates a config file in /etc/sysctl.d/ for the parameter that is changed so it should persist. https://docs.chef.io/resources/sysctl/
1 parent 7c85f17 commit 990354b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ This file is used to list changes made in each version of the AWS ParallelCluste
1010
- Remove security updates step executed on cluster nodes bootstrap in US isolated regions
1111
in order to reduce bootstrap time and avoid a potential point of failure.
1212

13+
**BUG FIXES**
14+
- Fix an issue that was preventing ptrace protection from being disabled on Ubuntu and allowing Cross Memory Attach (CMA) in libfabric.
15+
1316
3.6.0
1417
------
1518

cookbooks/aws-parallelcluster-common/resources/efa/partial/_disable_ptrace_debian.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
action :disable_ptrace do
1717
# Disabling ptrace protection is needed for EFA in order to use SHA transfer for intra-node communication.
18-
if node['cluster']['enable_efa'] == 'compute' && node['cluster']['node_type'] == 'ComputeFleet'
18+
if node['cluster']['enable_efa'] == 'efa' && node['cluster']['node_type'] == 'ComputeFleet'
1919
sysctl 'kernel.yama.ptrace_scope' do
2020
value 0
2121
end

cookbooks/aws-parallelcluster-common/spec/unit/resources/efa_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def mock_efa_supported(supported)
190190
elsif platform == 'ubuntu'
191191
context 'when efa enabled on compute node' do
192192
before do
193-
chef_run.node.override['cluster']['enable_efa'] = 'compute'
193+
chef_run.node.override['cluster']['enable_efa'] = 'efa'
194194
chef_run.node.override['cluster']['node_type'] = 'ComputeFleet'
195195
ConvergeEfa.configure(chef_run)
196196
end
@@ -214,7 +214,7 @@ def mock_efa_supported(supported)
214214

215215
context 'when it is not a compute node' do
216216
before do
217-
chef_run.node.override['cluster']['enable_efa'] = 'compute'
217+
chef_run.node.override['cluster']['enable_efa'] = 'efa'
218218
chef_run.node.override['cluster']['node_type'] = 'other'
219219
ConvergeEfa.configure(chef_run)
220220
end

0 commit comments

Comments
 (0)