From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Duoming Zhou <duoming@zju.edu.cn>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, andrew@lunn.ch,
gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com
Subject: Re: [PATCH] ARM: mvebu: Prevent null pointer dereference caused by kzalloc failure
Date: Sun, 25 Feb 2024 11:29:53 +0000 [thread overview]
Message-ID: <ZdsksQG/vMS0lWGq@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240225060401.52768-1-duoming@zju.edu.cn>
On Sun, Feb 25, 2024 at 02:04:01PM +0800, Duoming Zhou wrote:
> The kzalloc() in i2c_quirk() will return null if the physical
> memory has run out. As a result, if we dereference the new_compat
> pointer, the null pointer dereference bug will happen.
>
> This patch adds a check to avoid null pointer dereference.
Yet again another janitorial patch that is Way too focused on a single
issue, rather than analysing the code and proposing the best fix. :(
What if the two kstrdup() fail?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Duoming Zhou <duoming@zju.edu.cn>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, andrew@lunn.ch,
gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com
Subject: Re: [PATCH] ARM: mvebu: Prevent null pointer dereference caused by kzalloc failure
Date: Sun, 25 Feb 2024 11:29:53 +0000 [thread overview]
Message-ID: <ZdsksQG/vMS0lWGq@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240225060401.52768-1-duoming@zju.edu.cn>
On Sun, Feb 25, 2024 at 02:04:01PM +0800, Duoming Zhou wrote:
> The kzalloc() in i2c_quirk() will return null if the physical
> memory has run out. As a result, if we dereference the new_compat
> pointer, the null pointer dereference bug will happen.
>
> This patch adds a check to avoid null pointer dereference.
Yet again another janitorial patch that is Way too focused on a single
issue, rather than analysing the code and proposing the best fix. :(
What if the two kstrdup() fail?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-02-25 11:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-25 6:04 [PATCH] ARM: mvebu: Prevent null pointer dereference caused by kzalloc failure Duoming Zhou
2024-02-25 6:04 ` Duoming Zhou
2024-02-25 11:29 ` Russell King (Oracle) [this message]
2024-02-25 11:29 ` Russell King (Oracle)
2024-02-25 13:12 ` duoming
2024-02-25 13:12 ` duoming
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=ZdsksQG/vMS0lWGq@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=duoming@zju.edu.cn \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.com \
/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.