Lines Matching defs:buffer
14 * 2. pkey_mprotect() apply this pkey to a piece of memory(buffer)
15 * 3. check if access right of the buffer has been changed and take effect
16 * 4. remove the access right(pkey) from this buffer via pkey_mprotect()
17 * 5. check if buffer area can be read or write after removing pkey
131 char *buffer;
136 tst_res(TINFO, "Skip test on (%s) buffer", flag_to_str(mpa->flags));
143 buffer = SAFE_MMAP(NULL, size, mpa->prot, mpa->flags, fd, 0);
149 tst_res(TINFO, "Set %s on (%s) buffer", tc->name, flag_to_str(mpa->flags));
150 if (ltp_pkey_mprotect(buffer, size, mpa->prot, pkey) == -1)
160 "Read buffer success, buffer[0] = %d", *buffer);
163 *buffer = 'a';
165 "Write buffer success, buffer[0] = %d", *buffer);
178 tst_res(TINFO, "Remove %s from the buffer", tc->name);
179 if (ltp_pkey_mprotect(buffer, size, mpa->prot, 0x0) == -1)
184 tst_res(TPASS, "Read buffer success, buffer[0] = %d", *buffer);
187 *buffer = 'a';
188 tst_res(TPASS, "Write buffer success, buffer[0] = %d", *buffer);
192 *buffer = 'a';
193 tst_res(TPASS, "Read & Write buffer success, buffer[0] = %d", *buffer);
200 SAFE_MUNMAP(buffer, size);