All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Brendan Jackman <jackmanb@google.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH stable] ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()
Date: Mon, 30 Jun 2025 21:15:23 -0400	[thread overview]
Message-ID: <20250630142531-e1d4b066523883eb@stable.kernel.org> (raw)
In-Reply-To: <20250630-ipmi-fix-v1-1-2d496de3c856@google.com>

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: fa332f5dc6fc662ad7d3200048772c96b861cf6b

WARNING: Author mismatch between patch and upstream commit:
Backport author: Brendan Jackman<jackmanb@google.com>
Commit author: Dan Carpenter<dan.carpenter@linaro.org>

Note: The patch differs from the upstream commit:
---
1:  fa332f5dc6fc6 ! 1:  5984afb270d63 ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()
    @@ Metadata
      ## Commit message ##
         ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()
     
    +    commit fa332f5dc6fc662ad7d3200048772c96b861cf6b upstream
    +
         The "intf" list iterator is an invalid pointer if the correct
         "intf->intf_num" is not found.  Calling atomic_dec(&intf->nr_users) on
         and invalid pointer will lead to memory corruption.
    @@ Commit message
         Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
         Message-ID: <aBjMZ8RYrOt6NOgi@stanley.mountain>
         Signed-off-by: Corey Minyard <corey@minyard.net>
    +    Signed-off-by: Brendan Jackman <jackmanb@google.com>
     
      ## drivers/char/ipmi/ipmi_msghandler.c ##
     @@ drivers/char/ipmi/ipmi_msghandler.c: int ipmi_create_user(unsigned int          if_num,
    @@ drivers/char/ipmi/ipmi_msghandler.c: int ipmi_create_user(unsigned int
     +	goto out_unlock;
      
       found:
    - 	if (intf->in_shutdown) {
    - 		rv = -ENODEV;
    --		goto out_kfree;
    -+		goto out_unlock;
    - 	}
    - 
      	if (atomic_add_return(1, &intf->nr_users) > max_users) {
     @@ drivers/char/ipmi/ipmi_msghandler.c: int ipmi_create_user(unsigned int          if_num,
    - 	} else {
    - 		*user = new_user;
    - 	}
    + 
    + out_kfree:
    + 	atomic_dec(&intf->nr_users);
     +out_unlock:
    - 	mutex_unlock(&ipmi_interfaces_mutex);
    + 	srcu_read_unlock(&ipmi_interfaces_srcu, index);
    + 	vfree(new_user);
      	return rv;
    - }
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.15.y       |  Success    |  Success   |
| stable/linux-6.12.y       |  Success    |  Success   |
| stable/linux-6.6.y        |  Success    |  Success   |
| stable/linux-6.1.y        |  Success    |  Success   |
| stable/linux-5.15.y       |  Success    |  Success   |
| stable/linux-5.10.y       |  Success    |  Success   |
| stable/linux-5.4.y        |  Success    |  Success   |

      parent reply	other threads:[~2025-07-01  1:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 17:09 [PATCH stable] ipmi:msghandler: Fix potential memory corruption in ipmi_create_user() Brendan Jackman
2025-06-30 18:10 ` Greg KH
2025-07-01  9:52   ` Brendan Jackman
2025-07-01 10:14     ` Greg KH
2025-07-01 11:29       ` Brendan Jackman
2025-07-01  1:15 ` Sasha Levin [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=20250630142531-e1d4b066523883eb@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=jackmanb@google.com \
    --cc=stable@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.