Hi Marco,
I love your patch! Perhaps something to improve:
[auto build test WARNING on hnaz-linux-mm/master]
[also build test WARNING on arm64/for-next/core linus/master v5.9-rc5]
[cannot apply to tip/x86/core next-20200915]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Marco-Elver/KFENCE-A-low-overhea...
base:
https://github.com/hnaz/linux-mm master
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
mm/kfence/kfence_test.c: In function 'report_matches':
> mm/kfence/kfence_test.c:150:1: warning: the frame size of 1032
bytes is larger than 1024 bytes [-Wframe-larger-than=]
150 | }
| ^
#
https://github.com/0day-ci/linux/commit/e52f64e8d3cbfe2423913871780cf012b...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Marco-Elver/KFENCE-A-low-overhead-sampling-based-memory-safety-error-detector/20200915-212305
git checkout e52f64e8d3cbfe2423913871780cf012b2abeb21
vim +150 mm/kfence/kfence_test.c
74
75 /* Check observed report matches information in @r. */
76 static bool report_matches(const struct expect_report *r)
77 {
78 bool ret = false;
79 unsigned long flags;
80 typeof(observed.lines) expect;
81 const char *end;
82 char *cur;
83
84 /* Doubled-checked locking. */
85 if (!report_available())
86 return false;
87
88 /* Generate expected report contents. */
89
90 /* Title */
91 cur = expect[0];
92 end = &expect[0][sizeof(expect[0]) - 1];
93 switch (r->type) {
94 case KFENCE_ERROR_OOB:
95 cur += scnprintf(cur, end - cur, "BUG: KFENCE: out-of-bounds");
96 break;
97 case KFENCE_ERROR_UAF:
98 cur += scnprintf(cur, end - cur, "BUG: KFENCE: use-after-free");
99 break;
100 case KFENCE_ERROR_CORRUPTION:
101 cur += scnprintf(cur, end - cur, "BUG: KFENCE: memory corruption");
102 break;
103 case KFENCE_ERROR_INVALID:
104 cur += scnprintf(cur, end - cur, "BUG: KFENCE: invalid access");
105 break;
106 case KFENCE_ERROR_INVALID_FREE:
107 cur += scnprintf(cur, end - cur, "BUG: KFENCE: invalid free");
108 break;
109 }
110
111 scnprintf(cur, end - cur, " in %pS", r->fn);
112 /* The exact offset won't match, remove it; also strip module name. */
113 cur = strchr(expect[0], '+');
114 if (cur)
115 *cur = '\0';
116
117 /* Access information */
118 cur = expect[1];
119 end = &expect[1][sizeof(expect[1]) - 1];
120
121 switch (r->type) {
122 case KFENCE_ERROR_OOB:
123 cur += scnprintf(cur, end - cur, "Out-of-bounds access at");
124 break;
125 case KFENCE_ERROR_UAF:
126 cur += scnprintf(cur, end - cur, "Use-after-free access at");
127 break;
128 case KFENCE_ERROR_CORRUPTION:
129 cur += scnprintf(cur, end - cur, "Corrupted memory at");
130 break;
131 case KFENCE_ERROR_INVALID:
132 cur += scnprintf(cur, end - cur, "Invalid access at");
133 break;
134 case KFENCE_ERROR_INVALID_FREE:
135 cur += scnprintf(cur, end - cur, "Invalid free of");
136 break;
137 }
138
139 cur += scnprintf(cur, end - cur, " 0x" PTR_FMT, (void *)r->addr);
140
141 spin_lock_irqsave(&observed.lock, flags);
142 if (!report_available())
143 goto out; /* A new report is being captured. */
144
145 /* Finally match expected output to what we actually observed. */
146 ret = strstr(observed.lines[0], expect[0]) && strstr(observed.lines[1],
expect[1]);
147 out:
148 spin_unlock_irqrestore(&observed.lock, flags);
149 return ret;
150 }
151
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org