Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: sashiko-reviews@lists.linux.dev, linux-can@vger.kernel.org,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Vincent Mailhol <mailhol@kernel.org>
Subject: Re: [PATCH 3/3] can: enable memcg accounting for user triggered allocations
Date: Sun, 8 Nov 2026 09:23:15 +0100	[thread overview]
Message-ID: <avAxc4PqfptAXTy_@pengutronix.de> (raw)
In-Reply-To: <86c9e6d5-911b-4329-81b7-bb611a9f333a@hartkopp.net>

On Sat, Nov 07, 2026 at 02:35:20PM +0100, Oliver Hartkopp wrote:
> 
> 
> On 07.11.26 14:14, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found no new issues
> > in this patch, but noticed 1 related pre-existing issue it does not
> > introduce:
> > - [Medium] can: j1939: non-zero setsockopt return value in
> >    j1939_sk_setsockopt_flag() [1]
> > --
> > 
> > commit b3ee6688711331e68a7e275f9b72d5b3fa8b7ee5
> > Author: Oliver Hartkopp <socketcan@hartkopp.net>
> > 
> > can: enable memcg accounting for user triggered allocations
> > 
> > This commit enables memcg accounting via GFP_KERNEL_ACCOUNT and
> > SLAB_ACCOUNT for user-triggered allocations in the CAN core, BCM, ISOTP,
> > J1939, and RAW socket protocols.
> > 
> > Link: https://lore.kernel.org/linux-can/350df96b-5f69-490e-b39e-ed6e9bca4754@hartkopp.net/
> > 
> > > diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
> > > index 50a598ef5fd4a..c832465876049 100644
> > > --- a/net/can/j1939/socket.c
> > > +++ b/net/can/j1939/socket.c
> > > @@ -716,9 +716,14 @@ static int j1939_sk_setsockopt(struct socket *sock, int level, int optname,
> > >   				return -EINVAL;
> > >   			count = optlen / sizeof(*filters);
> > > -			filters = memdup_sockptr(optval, optlen);
> > > -			if (IS_ERR(filters))
> > > -				return PTR_ERR(filters);
> > > +			filters = kmalloc(optlen, GFP_KERNEL_ACCOUNT);
> > > +			if (!filters)
> > > +				return -ENOMEM;
> > > +
> > > +			if (copy_from_sockptr(filters, optval, optlen)) {
> > > +				kfree(filters);
> > > +				return -EFAULT;
> > > +			}
> > >   			for (f = filters, c = count; c; f++, c--) {
> > >   				f->name &= f->name_mask;
> > 
> > [Severity: Medium]
> > This problem wasn't introduced by this patch, but should
> > j1939_sk_setsockopt_flag() return 0 instead of tmp [1]?
> 
> This might be a can-next topic and has nothing to do with this patch.
> 
> @Oleksij: Would you like to take this suggestion?

Ack, on my todo.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2026-11-08  8:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 13:06 [PATCH 0/3] can: bcm: avoid RTNL stalls and enable memcg accounting Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 1/3] can: bcm: copy the CAN frames outside of lock_sock() Oliver Hartkopp
2026-11-07 13:15   ` sashiko-bot
2026-11-07 13:29     ` Oliver Hartkopp
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  7:56     ` Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 2/3] can: bcm: do not remove the procfs entry in bcm_notify() Oliver Hartkopp
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  8:00     ` Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 3/3] can: enable memcg accounting for user triggered allocations Oliver Hartkopp
2026-11-07 13:14   ` sashiko-bot
2026-11-07 13:35     ` Oliver Hartkopp
2026-11-08  8:23       ` Oleksij Rempel [this message]
2026-11-08  8:21     ` Oleksij Rempel
2026-11-08  8:25   ` Oleksij Rempel
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  8:09     ` Oliver Hartkopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avAxc4PqfptAXTy_@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox