All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-sctp@vger.kernel.org
Subject: Re: [bug report] net/sctp: convert sctp_getsockopt_peeloff_common() to FD_PREPARE()
Date: Wed, 26 Nov 2025 11:37:29 +0300	[thread overview]
Message-ID: <aSa8SXDUZHq62XuB@stanley.mountain> (raw)
In-Reply-To: <aSa7l8aK1cHv1GEI@stanley.mountain>

Similar warning in sock_map_fd()

net/socket.c:510 sock_map_fd() warn: passing freed memory 'sock' (line 508)

net/socket.c
   504  static int sock_map_fd(struct socket *sock, int flags)
   505  {
   506          int fd;
   507  
   508          fd = FD_ADD(flags, sock_alloc_file(sock, flags, NULL));
                                                   ^^^^
Freed on error.

   509          if (fd < 0)
   510                  sock_release(sock);
                        ^^^^^^^^^^^^^^^^^^
double freed.

   511          return fd;
   512  }

regards,
dan carpenter

      reply	other threads:[~2025-11-26  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  8:34 [bug report] net/sctp: convert sctp_getsockopt_peeloff_common() to FD_PREPARE() Dan Carpenter
2025-11-26  8:37 ` Dan Carpenter [this message]

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=aSa8SXDUZHq62XuB@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=brauner@kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.