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

amdgpu-i2c: init at 0.0.1 #371618

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22587,6 +22587,12 @@
githubId = 1141680;
name = "Thane Gill";
};
thardin = {
email = "[email protected]";
github = "Tyler-Hardin";
githubId = 5404976;
name = "Tyler Hardin";
};
thblt = {
name = "Thibault Polge";
email = "[email protected]";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/holidays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

buildPythonPackage rec {
pname = "holidays";
version = "0.63";
version = "0.64";
pyproject = true;

disabled = pythonOlder "3.8";
Expand All @@ -23,7 +23,7 @@ buildPythonPackage rec {
owner = "vacanza";
repo = "python-holidays";
tag = "v${version}";
hash = "sha256-XA6XvxWHttt+ic5027Q/3VGqrFYznYCiExSFBHU7qcY=";
hash = "sha256-rPQr7nyouBepTi4tW0+wrbROYyWo92KkZUI6ff5jl7I=";
};

build-system = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/mypy-boto3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ rec {
"sha256-LFhzVLxycvIbGPCIMvD18XAL8KkA1rnE+3LkFty4Q8s=";

mypy-boto3-iotsecuretunneling =
buildMypyBoto3Package "iotsecuretunneling" "1.35.0"
"sha256-A1sYvlnpbfKZyxZvFCzBfD/Jbzd1PwlQwgj+fvcybGU=";
buildMypyBoto3Package "iotsecuretunneling" "1.35.93"
"sha256-HBXnSdkTqLdcwSQl42FfFZhQVDiErGfJShaGgt0I7bU=";

mypy-boto3-iotsitewise =
buildMypyBoto3Package "iotsitewise" "1.35.64"
Expand Down
39 changes: 39 additions & 0 deletions pkgs/os-specific/linux/amdgpu-i2c/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
stdenv,
lib,
fetchFromGitHub,
kernel,
}:

stdenv.mkDerivation rec {
pname = "amdgpu-i2c";
version = "0.0.1";

src = fetchFromGitHub {
owner = "twifty";
repo = pname;
rev = "master";
sha256 = "sha256-GVyrwnwNSBW4OCNDqQMU6e31C4bG14arC0MPkRWfiJQ=";
};

hardeningDisable = [ "pic" ];

nativeBuildInputs = kernel.moduleBuildDependencies;

KDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";

buildPhase = "make -C ${KDIR} M=/build/source modules";
installPhase = ''
make -C ${KDIR} M=/build/source INSTALL_MOD_PATH="$out" modules_install
'';

meta = with lib; {
homepage = "https://github.com/twifty/amd-gpu-i2c";
downloadPage = "https://github.com/twifty/amd-gpu-i2c";
description = "Exposes i2c interface to set colors on AMD GPUs";
broken = lib.versionOlder kernel.version "6.11.0";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ thardin ];
};
}
75 changes: 75 additions & 0 deletions pkgs/test/cc-wrapper/hardening.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, runCommand
, runCommandWith
, runCommandCC
, bintools
, hello
, debian-devscripts
}:
Expand Down Expand Up @@ -130,6 +131,56 @@ let
'';

brokenIf = cond: drv: if cond then drv.overrideAttrs (old: { meta = old.meta or {} // { broken = true; }; }) else drv;
overridePlatforms = platforms: drv: drv.overrideAttrs (old: { meta = old.meta or {} // { inherit platforms; }; });

instructionPresenceTest = label: mnemonicPattern: testBin: expectFailure: runCommand "${label}-instr-test" {
nativeBuildInputs = [
bintools
];
buildInputs = [
testBin
];
} ''
touch $out
if $OBJDUMP -d \
--no-addresses \
--no-show-raw-insn \
"$(PATH=$HOST_PATH type -P test-bin)" \
| grep -E '${mnemonicPattern}' > /dev/null ; then
echo "Found ${label} instructions" >&2
${lib.optionalString expectFailure "exit 1"}
else
echo "Did not find ${label} instructions" >&2
${lib.optionalString (!expectFailure) "exit 1"}
fi
'';

pacRetTest = testBin: expectFailure: overridePlatforms [ "aarch64-linux" ] (
instructionPresenceTest "pacret" "\\bpaciasp\\b" testBin expectFailure
);

elfNoteTest = label: pattern: testBin: expectFailure: runCommand "${label}-elf-note-test" {
nativeBuildInputs = [
bintools
];
buildInputs = [
testBin
];
} ''
touch $out
if $READELF -n "$(PATH=$HOST_PATH type -P test-bin)" \
| grep -E '${pattern}' > /dev/null ; then
echo "Found ${label} note" >&2
${lib.optionalString expectFailure "exit 1"}
else
echo "Did not find ${label} note" >&2
${lib.optionalString (!expectFailure) "exit 1"}
fi
'';

shadowStackTest = testBin: expectFailure: brokenIf stdenv.hostPlatform.isMusl (overridePlatforms [ "x86_64-linux" ] (
elfNoteTest "shadowstack" "\\bSHSTK\\b" testBin expectFailure
));

in nameDrvAfterAttrName ({
bindNowExplicitEnabled = brokenIf stdenv.hostPlatform.isStatic (checkTestBin (f2exampleWithStdEnv stdenv {
Expand Down Expand Up @@ -204,6 +255,14 @@ in nameDrvAfterAttrName ({
ignoreStackClashProtection = false;
});

pacRetExplicitEnabled = pacRetTest (helloWithStdEnv stdenv {
hardeningEnable = [ "pacret" ];
}) false;

shadowStackExplicitEnabled = shadowStackTest (f1exampleWithStdEnv stdenv {
hardeningEnable = [ "shadowstack" ];
}) false;

bindNowExplicitDisabled = checkTestBin (f2exampleWithStdEnv stdenv {
hardeningDisable = [ "bindnow" ];
}) {
Expand Down Expand Up @@ -271,6 +330,14 @@ in nameDrvAfterAttrName ({
expectFailure = true;
};

pacRetExplicitDisabled = pacRetTest (helloWithStdEnv stdenv {
hardeningDisable = [ "pacret" ];
}) true;

shadowStackExplicitDisabled = shadowStackTest (f1exampleWithStdEnv stdenv {
hardeningDisable = [ "shadowstack" ];
}) true;

# most flags can't be "unsupported" by compiler alone and
# binutils doesn't have an accessible hardeningUnsupportedFlags
# mechanism, so can only test a couple of flags through altered
Expand Down Expand Up @@ -472,4 +539,12 @@ in {
ignoreStackClashProtection = false;
expectFailure = true;
};

allExplicitDisabledPacRet = pacRetTest (helloWithStdEnv stdenv {
hardeningDisable = [ "all" ];
}) true;

allExplicitDisabledShadowStack = shadowStackTest (f1exampleWithStdEnv stdenv {
hardeningDisable = [ "all" ];
}) true;
}))
2 changes: 2 additions & 0 deletions pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ in {

akvcam = callPackage ../os-specific/linux/akvcam { };

amdgpui2c = callPackage ../os-specific/linux/amdgpu-i2c { };

amneziawg = callPackage ../os-specific/linux/amneziawg { };

apfs = callPackage ../os-specific/linux/apfs { };
Expand Down