hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/x86/kernel/uprobes.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * User-space Probes (UProbes) for x86
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
174 *
185 * Copyright (C) IBM Corporation, 2008-2011
196 * Authors:
....@@ -735,8 +722,9 @@
735722 switch (opc1) {
736723 case 0xeb: /* jmp 8 */
737724 case 0xe9: /* jmp 32 */
738
- case 0x90: /* prefix* + nop; same as jmp with .offs = 0 */
739725 break;
726
+ case 0x90: /* prefix* + nop; same as jmp with .offs = 0 */
727
+ goto setup;
740728
741729 case 0xe8: /* call relative */
742730 branch_clear_offset(auprobe, insn);
....@@ -750,6 +738,7 @@
750738 * OPCODE1() of the "short" jmp which checks the same condition.
751739 */
752740 opc1 = OPCODE2(insn) - 0x10;
741
+ fallthrough;
753742 default:
754743 if (!is_cond_jmp_opcode(opc1))
755744 return -ENOSYS;
....@@ -765,6 +754,7 @@
765754 return -ENOTSUPP;
766755 }
767756
757
+setup:
768758 auprobe->branch.opc1 = opc1;
769759 auprobe->branch.ilen = insn->length;
770760 auprobe->branch.offs = insn->immediate.value;
....@@ -856,8 +846,8 @@
856846
857847 /**
858848 * arch_uprobe_analyze_insn - instruction analysis including validity and fixups.
849
+ * @auprobe: the probepoint information.
859850 * @mm: the probed address space.
860
- * @arch_uprobe: the probepoint information.
861851 * @addr: virtual address at which to install the probepoint
862852 * Return 0 on success or a -ve number on error.
863853 */
....@@ -906,7 +896,7 @@
906896 fix_ip_or_call = 0;
907897 break;
908898 }
909
- /* fall through */
899
+ fallthrough;
910900 default:
911901 riprel_analyze(auprobe, &insn);
912902 }
....@@ -1091,7 +1081,7 @@
10911081 pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n",
10921082 current->pid, regs->sp, regs->ip);
10931083
1094
- force_sig(SIGSEGV, current);
1084
+ force_sig(SIGSEGV);
10951085 }
10961086
10971087 return -1;