linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm/compat: Remove use of kmalloc_track_caller
@ 2020-11-01 22:08 Alistair Delva
  2020-11-01 23:34 ` Dmitry Safonov
  2020-11-02  3:38 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Alistair Delva @ 2020-11-01 22:08 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: linux-kernel, netdev, Jakub Kicinski, David S . Miller,
	Herbert Xu, kernel-team, Maciej Żenczykowski,
	Steffen Klassert

The __kmalloc_track_caller symbol is not exported if SLUB/SLOB are
enabled instead of SLAB, which breaks the build on such configs when
CONFIG_XFRM_USER_COMPAT=m.

ERROR: "__kmalloc_track_caller" [net/xfrm/xfrm_compat.ko] undefined!

Other users of this symbol are 'bool' options, but changing this to
bool would require XFRM_USER to be built in as well, which doesn't
seem worth it. Go back to kmalloc().

Fixes: 96392ee5a13b9 ("xfrm/compat: Translate 32-bit user_policy from sockptr")
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Alistair Delva <adelva@google.com>
---
 net/xfrm/xfrm_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c
index e28f0c9ecd6a..c1dee0696dfb 100644
--- a/net/xfrm/xfrm_compat.c
+++ b/net/xfrm/xfrm_compat.c
@@ -585,7 +585,7 @@ static int xfrm_user_policy_compat(u8 **pdata32, int optlen)
 	if (optlen < sizeof(*p))
 		return -EINVAL;
 
-	data64 = kmalloc_track_caller(optlen + 4, GFP_USER | __GFP_NOWARN);
+	data64 = kmalloc(optlen + 4, GFP_USER | __GFP_NOWARN);
 	if (!data64)
 		return -ENOMEM;
 
-- 
2.29.1.341.ge80a0c044ae-goog


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

* Re: [PATCH] xfrm/compat: Remove use of kmalloc_track_caller
  2020-11-01 22:08 [PATCH] xfrm/compat: Remove use of kmalloc_track_caller Alistair Delva
@ 2020-11-01 23:34 ` Dmitry Safonov
  2020-11-02  3:38 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Safonov @ 2020-11-01 23:34 UTC (permalink / raw)
  To: Alistair Delva
  Cc: linux-kernel, netdev, Jakub Kicinski, David S . Miller,
	Herbert Xu, kernel-team, Maciej Żenczykowski,
	Steffen Klassert

On 11/1/20 10:08 PM, Alistair Delva wrote:
> The __kmalloc_track_caller symbol is not exported if SLUB/SLOB are
> enabled instead of SLAB, which breaks the build on such configs when
> CONFIG_XFRM_USER_COMPAT=m.
> 
> ERROR: "__kmalloc_track_caller" [net/xfrm/xfrm_compat.ko] undefined!
> 
> Other users of this symbol are 'bool' options, but changing this to
> bool would require XFRM_USER to be built in as well, which doesn't
> seem worth it. Go back to kmalloc().
> 
> Fixes: 96392ee5a13b9 ("xfrm/compat: Translate 32-bit user_policy from sockptr")
> Cc: Dmitry Safonov <0x7f454c46@gmail.com>
> Cc: Maciej Żenczykowski <maze@google.com>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Alistair Delva <adelva@google.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

Thank you!

--
          Dmitry

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

* Re: [PATCH] xfrm/compat: Remove use of kmalloc_track_caller
  2020-11-01 22:08 [PATCH] xfrm/compat: Remove use of kmalloc_track_caller Alistair Delva
  2020-11-01 23:34 ` Dmitry Safonov
@ 2020-11-02  3:38 ` Herbert Xu
  2020-11-02  4:08   ` Alistair Delva
  1 sibling, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2020-11-02  3:38 UTC (permalink / raw)
  To: Alistair Delva
  Cc: Dmitry Safonov, linux-kernel, netdev, Jakub Kicinski,
	David S . Miller, kernel-team, Maciej Żenczykowski,
	Steffen Klassert

On Sun, Nov 01, 2020 at 02:08:45PM -0800, Alistair Delva wrote:
> The __kmalloc_track_caller symbol is not exported if SLUB/SLOB are
> enabled instead of SLAB, which breaks the build on such configs when
> CONFIG_XFRM_USER_COMPAT=m.
> 
> ERROR: "__kmalloc_track_caller" [net/xfrm/xfrm_compat.ko] undefined!

Is this with a recent kernel? Because they should be exported:

commit fd7cb5753ef49964ea9db5121c3fc9a4ec21ed8e
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Mar 23 15:49:00 2020 +0100

    mm/sl[uo]b: export __kmalloc_track(_node)_caller

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] xfrm/compat: Remove use of kmalloc_track_caller
  2020-11-02  3:38 ` Herbert Xu
@ 2020-11-02  4:08   ` Alistair Delva
  0 siblings, 0 replies; 4+ messages in thread
From: Alistair Delva @ 2020-11-02  4:08 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Dmitry Safonov, LKML, Network Development, Jakub Kicinski,
	David S . Miller, kernel-team, Maciej Żenczykowski,
	Steffen Klassert

On Sun, Nov 1, 2020 at 7:39 PM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>> On Sun, Nov 01, 2020 at 02:08:45PM -0800, Alistair Delva wrote:
> > The __kmalloc_track_caller symbol is not exported if SLUB/SLOB are
> > enabled instead of SLAB, which breaks the build on such configs when
> > CONFIG_XFRM_USER_COMPAT=m.
> >
> > ERROR: "__kmalloc_track_caller" [net/xfrm/xfrm_compat.ko] undefined!
>
> Is this with a recent kernel? Because they should be exported:
>
> commit fd7cb5753ef49964ea9db5121c3fc9a4ec21ed8e
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Mon Mar 23 15:49:00 2020 +0100
>
>     mm/sl[uo]b: export __kmalloc_track(_node)_caller

Whoops, you're right - I confused two allmodconfig issues when
backporting. Sorry for the noise.

> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>

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

end of thread, other threads:[~2020-11-02  4:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 22:08 [PATCH] xfrm/compat: Remove use of kmalloc_track_caller Alistair Delva
2020-11-01 23:34 ` Dmitry Safonov
2020-11-02  3:38 ` Herbert Xu
2020-11-02  4:08   ` Alistair Delva

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).