linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, David Rivshin <drivshin@allworx.com>,
	Rabin Vincent <rabin@rab.in>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Russell King <rmk+kernel@armlinux.org.uk>
Subject: [PATCH 3.18 62/85] ARM: 8764/1: kgdb: fix NUMREGBYTES so that gdb_regs[] is the correct size
Date: Sun,  1 Jul 2018 18:02:20 +0200	[thread overview]
Message-ID: <20180701153124.837055940@linuxfoundation.org> (raw)
In-Reply-To: <20180701153122.365061142@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Rivshin <DRivshin@allworx.com>

commit 76ed0b803a2ab793a1b27d1dfe0de7955282cd34 upstream.

NUMREGBYTES (which is used as the size for gdb_regs[]) is incorrectly
based on DBG_MAX_REG_NUM instead of GDB_MAX_REGS. DBG_MAX_REG_NUM
is the number of total registers, while GDB_MAX_REGS is the number
of 'unsigned longs' it takes to serialize those registers. Since
FP registers require 3 'unsigned longs' each, DBG_MAX_REG_NUM is
smaller than GDB_MAX_REGS.

This causes GDB 8.0 give the following error on connect:
"Truncated register 19 in remote 'g' packet"

This also causes the register serialization/deserialization logic
to overflow gdb_regs[], overwriting whatever follows.

Fixes: 834b2964b7ab ("kgdb,arm: fix register dump")
Cc: <stable@vger.kernel.org> # 2.6.37+
Signed-off-by: David Rivshin <drivshin@allworx.com>
Acked-by: Rabin Vincent <rabin@rab.in>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/include/asm/kgdb.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/include/asm/kgdb.h
+++ b/arch/arm/include/asm/kgdb.h
@@ -76,7 +76,7 @@ extern int kgdb_fault_expected;
 
 #define KGDB_MAX_NO_CPUS	1
 #define BUFMAX			400
-#define NUMREGBYTES		(DBG_MAX_REG_NUM << 2)
+#define NUMREGBYTES		(GDB_MAX_REGS << 2)
 #define NUMCRITREGBYTES		(32 << 2)
 
 #define _R0			0



  parent reply	other threads:[~2018-07-01 18:37 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 16:01 [PATCH 3.18 00/85] 3.18.114-stable review Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 01/85] tools build: No need to make libapi for perf explicitly Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 02/85] tools build: Fix Makefile(s) to properly invoke tools build Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 03/85] af_key: Always verify length of provided sadb_key Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 04/85] fsnotify: fix ignore mask logic in send_to_group() Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 05/85] MIPS: io: Add barrier after register read in readX() Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 06/85] s390/smsgiucv: disable SMSG on module unload Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 07/85] isofs: fix potential memory leak in mount option parsing Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 08/85] scsi: iscsi: respond to netlink with unicast when appropriate Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 09/85] drm/msm: Fix possible null dereference on failure of get_pages() Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 10/85] parisc: time: Convert read_persistent_clock() to read_persistent_clock64() Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 11/85] scsi: isci: Fix infinite loop in while loop Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 12/85] net: phy: marvell: clear wol event before setting it Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 13/85] arm64: ptrace: remove addr_limit manipulation Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 14/85] selftests: ftrace: Add a testcase for multiple actions on trigger Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 16/85] x86/cpu/intel: Add missing TLB cpuid values Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 18/85] ARM: davinci: board-dm355-evm: fix broken networking Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 19/85] hexagon: add memset_io() helper Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 20/85] hexagon: export csum_partial_copy_nocheck Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 21/85] scsi: vmw-pvscsi: return DID_BUS_BUSY for adapter-initated aborts Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 22/85] parisc: drivers.c: Fix section mismatches Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 23/85] kthread, sched/wait: Fix kthread_parkme() wait-loop Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 24/85] mac80211: Adjust SAE authentication timeout Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 25/85] drm/omap: fix possible NULL ref issue in tiler_reserve_2d Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 27/85] can: dev: increase bus-off message severity Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 30/85] ARM: keystone: fix platform_domain_notifier array overrun Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 31/85] i2c: pmcmsp: return message count on master_xfer success Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 32/85] i2c: pmcmsp: fix error return from master_xfer Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 33/85] i2c: viperboard: return message count on master_xfer success Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 34/85] ARM: davinci: board-dm646x-evm: set VPIF capture card name Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 35/85] parisc: Move setup_profiling_timer() out of init section Greg Kroah-Hartman
2018-07-01 16:29   ` Helge Deller
2018-07-03  9:17     ` Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 37/85] tcp: do not overshoot window_clamp in tcp_rcv_space_adjust() Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 38/85] ext4: update mtime in ext4_punch_hole even if no blocks are released Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 39/85] ext4: fix fencepost error in check for inode count overflow during resize Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 40/85] btrfs: scrub: Dont use inode pages for device replace Greg Kroah-Hartman
2018-07-01 16:01 ` [PATCH 3.18 41/85] ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 42/85] libata: zpodd: make arrays cdb static, reduces object code size Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 43/85] libata: zpodd: small read overflow in eject_tray() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 44/85] libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 45/85] w1: mxc_w1: Enable clock before calling clk_get_rate() on it Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 46/85] fs/binfmt_misc.c: do not allow offset overflow Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 47/85] m68k/mm: Adjust VM area to be unmapped by gap size for __iounmap() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 48/85] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 49/85] usb: do not reset if a low-speed or full-speed device timed out Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 50/85] ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 51/85] ASoC: cirrus: i2s: Fix LRCLK configuration Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 53/85] mips: ftrace: fix static function graph tracing Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 54/85] branch-check: fix long->int truncation when profiling branches Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 55/85] ipmi:bt: Set the timeout before doing a capabilities check Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 56/85] fuse: atomic_o_trunc should truncate pagecache Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 57/85] fuse: dont keep dead fuse_conn at fuse_fill_super() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 58/85] powerpc/mm/hash: Add missing isync prior to kernel stack SLB switch Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 59/85] powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 60/85] powerpc/ptrace: Fix enforcement of DAWR constraints Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 61/85] powerpc/fadump: Unregister fadump on kexec down path Greg Kroah-Hartman
2018-07-01 16:02 ` Greg Kroah-Hartman [this message]
2018-07-01 16:02 ` [PATCH 3.18 63/85] mtd: cfi_cmdset_0002: Change write buffer to check correct value Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 64/85] mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 65/85] mtd: cfi_cmdset_0002: fix SEGV unlocking multiple chips Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 66/85] mtd: cfi_cmdset_0002: Fix unlocking requests crossing a chip boudary Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 67/85] mtd: cfi_cmdset_0002: Avoid walking all chips when unlocking Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 69/85] PCI: pciehp: Clear Presence Detect and Data Link Layer Status Changed on resume Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 70/85] MIPS: io: Add barrier after register read in inX() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 72/85] scsi: qla2xxx: Fix setting lower transfer speed if GPSC fails Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 73/85] UBIFS: Fix potential integer overflow in allocation Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 74/85] backlight: as3711_bl: Fix Device Tree node lookup Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 75/85] backlight: max8925_bl: " Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 76/85] backlight: tps65217_bl: " Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 77/85] media: v4l2-compat-ioctl32: prevent go past max size Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 78/85] media: cx231xx: Add support for AverMedia DVD EZMaker 7 Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 79/85] media: dvb_frontend: fix locking issues at dvb_frontend_get_event() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 80/85] nfsd: restrict rd_maxcount to svc_max_payload in nfsd_encode_readdir Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 81/85] video: uvesafb: Fix integer overflow in allocation Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 82/85] xen: Remove unnecessary BUG_ON from __unbind_from_irq() Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 83/85] udf: Detect incorrect directory size Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 84/85] block: Fix transfer when chunk sectors exceeds max Greg Kroah-Hartman
2018-07-01 16:02 ` [PATCH 3.18 85/85] dm thin: handle running out of data space vs concurrent discard Greg Kroah-Hartman
2018-07-01 19:37 ` [PATCH 3.18 00/85] 3.18.114-stable review Nathan Chancellor
2018-07-02  6:34   ` Greg Kroah-Hartman
2018-07-02  7:51 ` Harsh 'MSF Jarvis' Shandilya
2018-07-02  8:35   ` Greg Kroah-Hartman
2018-07-02 16:31 ` Guenter Roeck

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=20180701153124.837055940@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=daniel.thompson@linaro.org \
    --cc=drivshin@allworx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin@rab.in \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).