hw_breakpoint.c (6fcebf1302b43e7a610d1d2fa89f41e693249aa5) | hw_breakpoint.c (fab940755d1d78377901450b6ee7c77356e06821) |
---|---|
1/* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License as published by 4 * the Free Software Foundation; either version 2 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of --- 247 unchanged lines hidden (view full) --- 256 break; 257 case HW_BREAKPOINT_X: 258 /* 259 * We don't allow kernel breakpoints in places that are not 260 * acceptable for kprobes. On non-kprobes kernels, we don't 261 * allow kernel breakpoints at all. 262 */ 263 if (attr->bp_addr >= TASK_SIZE_MAX) { | 1/* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License as published by 4 * the Free Software Foundation; either version 2 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of --- 247 unchanged lines hidden (view full) --- 256 break; 257 case HW_BREAKPOINT_X: 258 /* 259 * We don't allow kernel breakpoints in places that are not 260 * acceptable for kprobes. On non-kprobes kernels, we don't 261 * allow kernel breakpoints at all. 262 */ 263 if (attr->bp_addr >= TASK_SIZE_MAX) { |
264#ifdef CONFIG_KPROBES | |
265 if (within_kprobe_blacklist(attr->bp_addr)) 266 return -EINVAL; | 264 if (within_kprobe_blacklist(attr->bp_addr)) 265 return -EINVAL; |
267#else 268 return -EINVAL; 269#endif | |
270 } 271 272 hw->type = X86_BREAKPOINT_EXECUTE; 273 /* 274 * x86 inst breakpoints need to have a specific undefined len. 275 * But we still need to check userspace is not trying to setup 276 * an unsupported length, to get a range breakpoint for example. 277 */ --- 275 unchanged lines hidden --- | 266 } 267 268 hw->type = X86_BREAKPOINT_EXECUTE; 269 /* 270 * x86 inst breakpoints need to have a specific undefined len. 271 * But we still need to check userspace is not trying to setup 272 * an unsupported length, to get a range breakpoint for example. 273 */ --- 275 unchanged lines hidden --- |