Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gvrose fips legacy 8 compliant/4.18.0 425.13.1 #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bd6357e
github actions: Incorporate feedback on workflows
gvrose8192 Oct 22, 2024
c3df0ad
ionic: clean interrupt before enabling queue to avoid credit race
gvrose8192 Oct 28, 2024
f443dda
ionic: fix use after netif_napi_del()
gvrose8192 Oct 7, 2024
d37ab59
netfilter: nftables: add catch-all set element support
gvrose8192 Oct 17, 2024
ed9224f
netfilter: nf_tables: Remove spurious code
gvrose8192 Oct 27, 2024
5328226
netfilter: nf_tables: honor NLM_F_CREATE and NLM_F_EXCL in event noti…
gvrose8192 Oct 18, 2024
80355bf
netfilter: nf_tables: integrate pipapo into commit protocol
gvrose8192 Oct 21, 2024
0350682
netfilter: nf_tables: disallow element updates of bound anonymous sets
gvrose8192 Oct 21, 2024
ccdc2f6
netfilter: nf_tables: disallow updates of anonymous sets
gvrose8192 Oct 21, 2024
1149429
netfilter: nf_tables: disallow timeout for anonymous sets
gvrose8192 Oct 21, 2024
7dd0473
netfilter: nf_tables: add nft_chain_add()
gvrose8192 Oct 21, 2024
5cc169d
netfilter: nf_tables: report use refcount overflow
gvrose8192 Oct 22, 2024
a8fe11b
netfilter: nf_tables: fix spurious set element insertion failure
gvrose8192 Oct 22, 2024
d870474
netfilter: nf_tables: don't skip expired elements during walk
gvrose8192 Oct 22, 2024
f2bb805
netfilter: nftables: rename set element data activation/deactivation …
gvrose8192 Oct 22, 2024
dbf56a2
netfilter: nftables: add nft_pernet() helper function
gvrose8192 Oct 22, 2024
2282ecd
netfilter: nf_tables: GC transaction API to avoid race with control p…
gvrose8192 Oct 22, 2024
b6e3aca
netfilter: nf_tables: adapt set backend to use GC transaction API
gvrose8192 Oct 23, 2024
0584d4e
netfilter: nf_tables: remove busy mark and gc batch API
gvrose8192 Oct 23, 2024
9125895
netfilter: nf_tables: fix false-positive lockdep splat
gvrose8192 Oct 23, 2024
b80380b
netfilter: nf_tables: fix kdoc warnings after gc rework
gvrose8192 Oct 23, 2024
ef414a3
netfilter: nf_tables: don't fail inserts if duplicate has expired
gvrose8192 Oct 23, 2024
7a82bf4
netfilter: nf_tables: fix GC transaction races with netns and netlink…
gvrose8192 Oct 23, 2024
903d942
netfilter: nf_tables: GC transaction race with netns dismantle
gvrose8192 Oct 23, 2024
70c4cda
netfilter: nf_tables: GC transaction race with abort path
gvrose8192 Oct 29, 2024
ff4e14d
netfilter: nf_tables: use correct lock to protect gc_list
gvrose8192 Oct 23, 2024
6f85cfc
netfilter: nf_tables: fix out of memory error handling
gvrose8192 Oct 23, 2024
e128fc4
netfilter: nf_tables: defer gc run if previous batch is still pending
gvrose8192 Oct 23, 2024
4610888
netfilter: nf_tables: fix nft_trans type confusion
gvrose8192 Oct 24, 2024
7e580ea
netfilter: nf_tables: disallow element removal on anonymous sets
gvrose8192 Oct 24, 2024
07f22cf
netfilter: nftables: update table flags from the commit phase
gvrose8192 Oct 24, 2024
fba8a39
netfilter: nf_tables: fix table flag updates
gvrose8192 Oct 24, 2024
d72c986
netfilter: nf_tables: disable toggling dormant table state more than …
gvrose8192 Oct 24, 2024
6eca119
netfilter: nf_tables: fix memleak when more than 255 elements expired
gvrose8192 Oct 24, 2024
74e2238
netfilter: nf_tables: mark set as dead when unbinding anonymous set w…
gvrose8192 Oct 26, 2024
b7b6632
netfilter: nf_tables: set backend .flush always succeeds
gvrose8192 Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/diffdiff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/usr/bin/env python3
# coding: utf-8
#

import argparse
import copy
import difflib
import io
import git
import os
import re
import subprocess
import sys
import tempfile

verbose = False


def get_upstream_commit(upstream, c):
for l in c.message.splitlines():
try:
sha = re.match('\s*commit\s+(?P<sha>\S+)', l).groups()[0].upper()
return upstream.commit(sha)
except:
True

def get_diff(d):
dif = ''
df = False
for l in d.splitlines():
if l[:10] == 'diff --git':
df = True
if not df:
continue
dif = dif + l + '\n'
return dif


def trim_unchanged_files(lines):
dl = []
ld = 0 # Last line with a 'diff --git' we saw
hd = False # Have we seen a changed line since ld?
i = 0
for i, l in enumerate(lines):
if l[:4] == '+++ ' or l[:4] == '--- ' :
continue
if l[0] == '+' or l[0] == '-':
hd = True
if l[:11] == ' diff --git':
if ld: # We are at a new diff now, last one started at 'ld'
if not hd:
dl.insert(0, (ld, i+1),)
ld = i
hd = False # Reset hasdiff to False as we start a new section
# and check the tail
if not hd:
dl.insert(0, (ld, i+1),)
# delete the unchanged file sections
for d in dl:
del lines[d[0]:d[1]]
return lines


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-v', action='store_true', help='Verbose')
parser.add_argument('--colour', action='store_true', help='Colorize the diff. Green for additions, red for deletions')
parser.add_argument('--commit', help='Commit in current tree to diffdiff. Default is the most recent commit.')
parser.add_argument('--upstream', help='A directory that contains the current upstream of linus kernel tree where we can find the commits we reference. Default is the current repo')
args = parser.parse_args()


if args.v:
verbose = True

srcgit = git.Repo.init('.')
upstream = git.Repo.init(args.upstream)
c = srcgit.head.commit if not args.commit else srcgit.commit(args.commit)
uc = get_upstream_commit(upstream, c)

dc = get_diff(srcgit.git.show(c))
duc = get_diff(upstream.git.show(uc))

with open('c.diff', 'w') as f:
f.write(dc)
with open('u.diff', 'w') as f:
f.write(duc)

res = subprocess.run(['diff', '-u', 'u.diff', 'c.diff'],
check=False, stdout=subprocess.PIPE)
lines = res.stdout.splitlines()
dd = []
for l in lines:
l = str(l)[2:-1]
if l[:6] == '-index':
continue
if l[:6] == '+index':
continue
if l[:3] == '-@@':
continue
if l[:3] == '+@@':
dd.append(' ' + l[1:])
continue
dd.append(l)

# trim diffs for files that did not change
lines = trim_unchanged_files(dd)

# colorize the diff
diffs = 0
if args.colour:
dd = []
for l in lines:
if l[0:4] != '+++ ' and l[0:4] != '--- ':
if l[0] == '+':
l = '\033[42m' + l + '\033[0m'
diffs = diffs + 1
if l[0] == '-':
l = '\033[41m' + l + '\033[0m'
diffs = diffs + 1
dd.append(l)
lines = dd


if diffs:
for l in lines:
print(l)

sys.exit(diffs)
26 changes: 26 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: GitHub Actions Sanity Check
run-name: ${{ github.actor }} is running actions - this runs as a sanity check 🚀
on:
push:
branches:
- '**'
- '!mainline'

jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
df .
df /
pwd
- run: echo "🍏 This job's status is ${{ job.status }}."
140 changes: 140 additions & 0 deletions .github/workflows/process-git-request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
require 'open3'

requestors = { "gvrose8192" => "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" }

def file_prepend(file, str)
new_contents = ""
File.open(file, 'r') do |fd|
contents = fd.read
new_contents = str << contents
end
# Overwrite file but now with prepended string on it
File.open(file, 'w') do |fd|
fd.write(new_contents)
end
end

def process_git_request(fname, target_branch, source_branch, prj_dir)
retcode = 200 #presume success
# puts "Opening file " + fname
file = File.new(fname, "w")
working_dir = prj_dir
# puts "Working Dir : " + working_dir
Dir.chdir working_dir
# puts "pwd : " + Dir.pwd
git_cmd = "git log --oneline --no-abbrev-commit origin/" + target_branch + ".." + "origin/" + source_branch
# puts git_cmd
out, err, status = Open3.capture3(git_cmd)
if status.exitstatus != 0
puts "Command error output is " + err
file.write("Command error output is " + err)
file.close
retcode = 201
return retcode
end
output_lines = out.split(' ')
# we just want the commit sha IDs
output_lines.each { |x|
# puts "This is output_lines " + x
upstream_diff = false
if !x[/\H/]
if x.length < 40
next
end
git_cmd = "git show " + x
gitlog_out, gitlog_err, gitlog_status = Open3.capture3(git_cmd)
if gitlog_status.exitstatus != 0
file.write("git show command error output is " + gitlog_err)
retcode = 201
end
loglines = gitlog_out.lines.map(&:chomp)
lines_counted = 0
local_diffdiff_sha = ""
upstream_diffdiff_sha = ""
loglines.each { |logline|
lines_counted = lines_counted + 1
if lines_counted == 1
local_commit_sha = logline.match("[0-9a-f]\{40\}")
local_diffdiff_sha = local_commit_sha.to_s
# puts "Local : " + local_diffdiff_sha
file.write("Merge Request sha: " + local_diffdiff_sha)
file.write("\n")
end
if lines_counted == 2 #email address
if !logline.downcase.include? "ciq.com"
# Bad Author
s = "error:\nBad " + logline + "\n"
puts s
file.write(s)
retcode = 201
else
file.write("\t" + logline + "\n")
end
end
if lines_counted > 1
if logline.downcase.include? "jira"
file.write("\t" + logline + "\n")
end
if logline.downcase.include? "upstream-diff"
upstream_diff = true
end
if logline.downcase.include? "commit"
commit_sha = logline.match("[0-9a-f]\{40\}")
upstream_diffdiff_sha = commit_sha.to_s
# puts "Upstream : " + upstream_diffdiff_sha
if (!upstream_diffdiff_sha.empty?)
file.write("\tUpstream sha: " + upstream_diffdiff_sha)
file.write("\n")
end
end
end
if lines_counted > 8 #Everything we need should be in the first 8 lines
break
end
}
if !local_diffdiff_sha.empty? && !upstream_diffdiff_sha.empty?
diff_cmd = Dir.pwd + "/.github/workflows/diffdiff.py --colour --commit " + local_diffdiff_sha
puts "diffdiff: " + diff_cmd
diff_out, diff_err, diff_status = Open3.capture3(diff_cmd)
if diff_status.exitstatus != 0 && !upstream_diff
puts "diffdiff out: " + diff_out
puts "diffdiff err: " + diff_err
retcode = 201
file.write("error:\nCommit: " + local_diffdiff_sha + " differs with no upstream tag in commit message\n")
end
end
end
}
file.close
return retcode
end

first_arg, *argv_in = ARGV
if argv_in.length < 5
puts "Not enough arguments: fname, target_branch, source_branch, prj_dir, pull_request, requestor"
exit
end
fname = first_arg.to_s
fname = "tmp-" + fname
# puts "filename is " + fname
target_branch = argv_in[0].to_s
# puts "target branch is " + target_branch
source_branch = argv_in[1].to_s
# puts "source branch is " + source_branch
prj_dir = argv_in[2].to_s
# puts "project dir is " + prj_dir
pullreq = argv_in[3].to_s
# puts "pull request is " + pullreq
requestor = argv_in[4].to_s
retcode = process_git_request(fname, target_branch, source_branch, prj_dir)
if retcode != 200
File.open(fname, 'r') do |fd|
contents = fd.read
puts contents
end
exit(1)
else
puts "Done"
end
exit(0)

55 changes: 55 additions & 0 deletions .github/workflows/process-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Pull Request Checker

on:
pull_request:
branches:
- '**'
- '!mainline'

permissions:
contents: read

jobs:
test:

runs-on:
labels: kernel-build
strategy:
matrix:
ruby-version: ['3.0']

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
# uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Python
uses: actions/setup-python@v5
- name: Run tests
run: |
/usr/bin/pip3 install gitPython
python -c "import sys; import git; print(sys.version)"
git fetch origin ${{ github.base_ref }}
git fetch origin ${{ github.head_ref }}
git remote add linux https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --shallow-since="3 years ago" linux
echo "Will run process-git-request.rb with:"
echo "fname = ${{ github.run_id }}"
echo "target_branch = ${{ github.base_ref }}"
echo "source_branch = ${{ github.head_ref }}"
echo "prj_dir = ${{ github.workspace }}"
echo "pull_request = ${{ github.ref }}"
echo "requestor = ${{ github.actor }}"
cd ${{ github.workspace }}
/usr/bin/ruby .github/workflows/process-git-request.rb ${{ github.run_id }} ${{ github.base_ref }} \
${{ github.head_ref }} ${{ github.workspace }} ${{ github.ref }} ${{ github.actor }}
33 changes: 33 additions & 0 deletions .github/workflows/push-check_aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build-arm64
container:
image: rockylinux:8
env:
ROCKY_ENV: rocky8
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf groupinstall 'Development Tools' -y
dnf install --enablerepo=devel bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-git/kernel-src-git
cp configs/kernel-4.18.0-aarch64.config .config
make olddefconfig
make -j8
Loading
Loading