From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, tj@kernel.org,
songmuchun@bytedance.com, shuah@kernel.org, shakeelb@google.com,
roman.gushchin@linux.dev, mhocko@kernel.org,
lizefan.x@bytedance.com, hannes@cmpxchg.org,
ivan.orlov0322@gmail.com, akpm@linux-foundation.org
Subject: [merged mm-stable] selftests-cgroup-add-malloc-failures-checks-in-test_memcontrol.patch removed from -mm tree
Date: Tue, 28 Mar 2023 16:21:17 -0700 [thread overview]
Message-ID: <20230328232118.4E7ADC433EF@smtp.kernel.org> (raw)
The quilt patch titled
Subject: selftests: cgroup: add 'malloc' failures checks in test_memcontrol
has been removed from the -mm tree. Its filename was
selftests-cgroup-add-malloc-failures-checks-in-test_memcontrol.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Ivan Orlov <ivan.orlov0322@gmail.com>
Subject: selftests: cgroup: add 'malloc' failures checks in test_memcontrol
Date: Sun, 26 Feb 2023 16:16:33 +0300
There are several 'malloc' calls in test_memcontrol, which can be
unsuccessful. This patch will add 'malloc' failures checking to give more
details about test's fail reasons and avoid possible undefined behavior
during the future null dereference (like the one in
alloc_anon_50M_check_swap function).
Link: https://lkml.kernel.org/r/20230226131634.34366-1-ivan.orlov0322@gmail.com
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/cgroup/test_memcontrol.c | 15 +++++++++++++
1 file changed, 15 insertions(+)
--- a/tools/testing/selftests/cgroup/test_memcontrol.c~selftests-cgroup-add-malloc-failures-checks-in-test_memcontrol
+++ a/tools/testing/selftests/cgroup/test_memcontrol.c
@@ -98,6 +98,11 @@ static int alloc_anon_50M_check(const ch
int ret = -1;
buf = malloc(size);
+ if (buf == NULL) {
+ fprintf(stderr, "malloc() failed\n");
+ return -1;
+ }
+
for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE)
*ptr = 0;
@@ -211,6 +216,11 @@ static int alloc_anon_noexit(const char
char *buf, *ptr;
buf = malloc(size);
+ if (buf == NULL) {
+ fprintf(stderr, "malloc() failed\n");
+ return -1;
+ }
+
for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE)
*ptr = 0;
@@ -778,6 +788,11 @@ static int alloc_anon_50M_check_swap(con
int ret = -1;
buf = malloc(size);
+ if (buf == NULL) {
+ fprintf(stderr, "malloc() failed\n");
+ return -1;
+ }
+
for (ptr = buf; ptr < buf + size; ptr += PAGE_SIZE)
*ptr = 0;
_
Patches currently in -mm which might be from ivan.orlov0322@gmail.com are
reply other threads:[~2023-03-28 23:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230328232118.4E7ADC433EF@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=ivan.orlov0322@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mhocko@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.com \
--cc=shuah@kernel.org \
--cc=songmuchun@bytedance.com \
--cc=tj@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.