Skip to contentSkip to conversation

linux-next: manual merge of the kunit-next tree with the apparmor tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Dec 8, 2022 – Dec 14, 2022 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the kunit-next tree got a conflict in:

security/apparmor/policy_unpack_test.c

between commits:

371e50a0b19f ("apparmor: make unpack_array return a trianary value") 32490541682b ("apparmor: Fix kunit test for out of bounds array")

from the apparmor tree and commit:

2c92044683f5 ("apparmor: test: make static symbols visible during kunit testing")

from the kunit-next tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 44 lines
Cheers,
Stephen Rothwell

diff --cc security/apparmor/policy_unpack_test.c
index 7465da42492d,f25cf2a023d5..000000000000
--- a/security/apparmor/policy_unpack_test.c
+++ b/security/apparmor/policy_unpack_test.c
@@@ -144,8 -147,8 +147,8 @@@ static void policy_unpack_test_unpack_a
  
  	puf->e->pos += TEST_ARRAY_BUF_OFFSET;
  
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, NULL, &array_size),
 -	array_size = aa_unpack_array(puf->e, NULL);
 -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, NULL, &array_size),
 +			TRI_TRUE);
  	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -159,8 -162,8 +162,8 @@@ static void policy_unpack_test_unpack_a
  
  	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
  
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
 -	array_size = aa_unpack_array(puf->e, name);
 -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
 +			TRI_TRUE);
  	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -175,8 -178,9 +178,8 @@@ static void policy_unpack_test_unpack_a
  	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
  	puf->e->end = puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16);
  
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
 -	array_size = aa_unpack_array(puf->e, name);
 -
 -	KUNIT_EXPECT_EQ(test, array_size, 0);
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
 +			TRI_FALSE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_NAMED_ARRAY_BUF_OFFSET);
  }
#1 lore raw

Hi all,

Quoted 58 lines · On Thu, 8 Dec 2022 12:46:53 +1100 Stephen Rothwell <[email protected]> wrote:

Today's linux-next merge of the kunit-next tree got a conflict in:

security/apparmor/policy_unpack_test.c

between commits:

371e50a0b19f ("apparmor: make unpack_array return a trianary value") 32490541682b ("apparmor: Fix kunit test for out of bounds array")

from the apparmor tree and commit:

2c92044683f5 ("apparmor: test: make static symbols visible during kunit testing")

from the kunit-next tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
security/apparmor/policy_unpack_test.c +2 -2
diff --cc security/apparmor/policy_unpack_test.c
index 7465da42492d,f25cf2a023d5..000000000000
@@@ -144,8 -147,8 +147,8 @@@ static void policy_unpack_test_unpack_a
 
  	puf->e->pos += TEST_ARRAY_BUF_OFFSET;
 
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, NULL, &array_size),
 -	array_size = aa_unpack_array(puf->e, NULL);
 -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, NULL, &array_size),
 +			TRI_TRUE);
  	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -159,8 -162,8 +162,8 @@@ static void policy_unpack_test_unpack_a
 
  	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
 
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
 -	array_size = aa_unpack_array(puf->e, name);
 -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
 +			TRI_TRUE);
  	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -175,8 -178,9 +178,8 @@@ static void policy_unpack_test_unpack_a
  	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
  	puf->e->end = puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16);

security/apparmor/policy_unpack_test.c

Quoted 10 lines
security/apparmor/policy_unpack_test.c +1 -1
 
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
 -	array_size = aa_unpack_array(puf->e, name);
 -
 -	KUNIT_EXPECT_EQ(test, array_size, 0);
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
 +			TRI_FALSE);
  	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
  		puf->e->start + TEST_NAMED_ARRAY_BUF_OFFSET);
  }

This is now a conflict between the apparmor tree and Linus' tree.

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw
Quoted 62 lines · Stephen Rothwell

Hi all,

Quoted 59 lines · On Thu, 8 Dec 2022 12:46:53 +1100 Stephen Rothwell <[email protected]> wrote:

Today's linux-next merge of the kunit-next tree got a conflict in:

security/apparmor/policy_unpack_test.c

between commits:

371e50a0b19f ("apparmor: make unpack_array return a trianary value") 32490541682b ("apparmor: Fix kunit test for out of bounds array")

from the apparmor tree and commit:

2c92044683f5 ("apparmor: test: make static symbols visible during kunit testing")

from the kunit-next tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
security/apparmor/policy_unpack_test.c +2 -2
diff --cc security/apparmor/policy_unpack_test.c
index 7465da42492d,f25cf2a023d5..000000000000
@@@ -144,8 -147,8 +147,8 @@@ static void policy_unpack_test_unpack_a
 
   	puf->e->pos += TEST_ARRAY_BUF_OFFSET;
 
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, NULL, &array_size),
  -	array_size = aa_unpack_array(puf->e, NULL);
  -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, NULL, &array_size),
  +			TRI_TRUE);
   	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
   	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
   		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -159,8 -162,8 +162,8 @@@ static void policy_unpack_test_unpack_a
 
   	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
 
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
  -	array_size = aa_unpack_array(puf->e, name);
  -
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
  +			TRI_TRUE);
   	KUNIT_EXPECT_EQ(test, array_size, (u16)TEST_ARRAY_SIZE);
   	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
   		puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16) + 1);
@@@ -175,8 -178,9 +178,8 @@@ static void policy_unpack_test_unpack_a
   	puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
   	puf->e->end = puf->e->start + TEST_ARRAY_BUF_OFFSET + sizeof(u16);
Quoted 12 lines

security/apparmor/policy_unpack_test.c

Quoted 9 lines
security/apparmor/policy_unpack_test.c +1 -1
- 	KUNIT_EXPECT_EQ(test, unpack_array(puf->e, name, &array_size),
  -	array_size = aa_unpack_array(puf->e, name);
  -
  -	KUNIT_EXPECT_EQ(test, array_size, 0);
++	KUNIT_EXPECT_EQ(test, aa_unpack_array(puf->e, name, &array_size),
  +			TRI_FALSE);
   	KUNIT_EXPECT_PTR_EQ(test, puf->e->pos,
   		puf->e->start + TEST_NAMED_ARRAY_BUF_OFFSET);
   }

This is now a conflict between the apparmor tree and Linus' tree.

sorry for the delay on this, build and regression testing took way longer than they should have.

apparmor merge request is now sent