linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the slab tree with the mm-stable, mm trees
@ 2024-01-02  4:13 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2024-01-02  4:13 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton
  Cc: Andrey Konovalov, Andrey Konovalov, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]

Hi all,

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

  mm/kasan/quarantine.c

between commits:

  773688a6cb24 ("kasan: use stack_depot_put for Generic mode")
  435736586ddc ("kasan: stop leaking stack trace handles")

from the mm-stable, mm trees and commit:

  72786c0a3dc5 ("KASAN: remove code paths guarded by CONFIG_SLAB")

from the slab 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.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/kasan/quarantine.c
index 8afa77bc5d3b,138c57b836f2..000000000000
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@@ -143,10 -143,7 +143,9 @@@ static void *qlink_to_object(struct qli
  static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
  {
  	void *object = qlink_to_object(qlink, cache);
 -	struct kasan_free_meta *meta = kasan_get_free_meta(cache, object);
 +	struct kasan_free_meta *free_meta = kasan_get_free_meta(cache, object);
- 	unsigned long flags;
 +
 +	kasan_release_object_meta(cache, object);
  
  	/*
  	 * If init_on_free is enabled and KASAN's free metadata is stored in
@@@ -156,15 -153,15 +155,9 @@@
  	 */
  	if (slab_want_init_on_free(cache) &&
  	    cache->kasan_info.free_meta_offset == 0)
 -		memzero_explicit(meta, sizeof(*meta));
 -
 -	/*
 -	 * As the object now gets freed from the quarantine, assume that its
 -	 * free track is no longer valid.
 -	 */
 -	*(u8 *)kasan_mem_to_shadow(object) = KASAN_SLAB_FREE;
 +		memzero_explicit(free_meta, sizeof(*free_meta));
  
- 	if (IS_ENABLED(CONFIG_SLAB))
- 		local_irq_save(flags);
- 
  	___cache_free(cache, object, _THIS_IP_);
- 
- 	if (IS_ENABLED(CONFIG_SLAB))
- 		local_irq_restore(flags);
  }
  
  static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* linux-next: manual merge of the slab tree with the mm-stable, mm trees
@ 2023-12-21  6:31 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2023-12-21  6:31 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton
  Cc: Andrey Konovalov, Andrey Konovalov, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]

Hi all,

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

  mm/kasan/quarantine.c

between commits:

  773688a6cb24 ("kasan: use stack_depot_put for Generic mode")
  f91ba46acc15 ("kasan: memset free track in qlink_free")

from the mm-stable, mm trees and commit:

  72786c0a3dc5 ("KASAN: remove code paths guarded by CONFIG_SLAB")

from the slab 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.

-- 
Cheers,
Stephen Rothwell

diff --cc mm/kasan/quarantine.c
index 782e045da911,138c57b836f2..000000000000
--- a/mm/kasan/quarantine.c
+++ b/mm/kasan/quarantine.c
@@@ -143,22 -143,7 +143,21 @@@ static void *qlink_to_object(struct qli
  static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
  {
  	void *object = qlink_to_object(qlink, cache);
 -	struct kasan_free_meta *meta = kasan_get_free_meta(cache, object);
 +	struct kasan_alloc_meta *alloc_meta = kasan_get_alloc_meta(cache, object);
 +	struct kasan_free_meta *free_meta = kasan_get_free_meta(cache, object);
- 	unsigned long flags;
 +
 +	if (alloc_meta) {
 +		stack_depot_put(alloc_meta->alloc_track.stack);
 +		stack_depot_put(alloc_meta->aux_stack[0]);
 +		stack_depot_put(alloc_meta->aux_stack[1]);
 +		__memset(alloc_meta, 0, sizeof(*alloc_meta));
 +	}
 +
 +	if (free_meta &&
 +	    *(u8 *)kasan_mem_to_shadow(object) == KASAN_SLAB_FREETRACK) {
 +		stack_depot_put(free_meta->free_track.stack);
 +		__memset(&free_meta->free_track, 0, sizeof(free_meta->free_track));
 +	}
  
  	/*
  	 * If init_on_free is enabled and KASAN's free metadata is stored in

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-02  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  4:13 linux-next: manual merge of the slab tree with the mm-stable, mm trees Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2023-12-21  6:31 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).