Received: by 10.223.185.116 with SMTP id b49csp4245537wrg; Mon, 19 Feb 2018 14:03:24 -0800 (PST) X-Google-Smtp-Source: AH8x227jpgmpw/+e76PlewpRdHq7aTdUqkpd+XOOS9cp9WrVbafdN5ct2P4Gn+VylmX246nA37UM X-Received: by 2002:a17:902:6b8a:: with SMTP id p10-v6mr2308194plk.432.1519077804037; Mon, 19 Feb 2018 14:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519077804; cv=none; d=google.com; s=arc-20160816; b=0OCpRptso1X91Y5TIY2ceBjYJba0ELVMvsfsTwydZPCnrG7TFZvwg2DdZMz8/czA0L 1Lgj2+CL6eV7cbW9gE7KkcPHw+riJxDPgaeBvg3oK5pFDeV7OmCvNo9QDCnHPVnFXfaO m5xEtTm8UMckkJMbWo4W9rSkL9YylZ4P2e/BMJb3pcIfZYGr8aMzsLlSFNahoQq3ZeoD 68fJeoEclQpUBVEyPT9jfJHl+hVc4g4UGHLdjDSoew0CpUDwrIjs9SkUtLGTBeDuOrdW zr48Mf95LZqEdAhYanz+E0NcuevM9vWeB/eLIZNp5bX4LIMYDxQyNAQHh9hpqIIPfShX BMyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fhMp6xNOIZCi4yXAenQ3n5vo9QUkyvjgTbMdQtf+0U4=; b=d4Opd8MLTSLXQXuYH8xOgb0Bdnp4exJyIYk6yamtLlHppAwwnMxZZJ14WJo/mU1yU3 fqXqz4Sb28Z40QquhFM+bA0hz0g+adYnc6A9C8sFs6Ov9kXWg6vu2kapnmk2ev2tiSOL SPqAU337nzK2Gl01VF6um7onVVinz8DRsBDBAt5nINAJK/GBENYlu9GrU9VIHQb5yiR0 XI2v3i74du7PAJ26nxucOt53XQ45F9gDu3KOV/vaYaQClNWodoEUleMAd3i4uB7U+uCL kZrbWgENsE4x7exhgrFjBQCVeXy/oK3wImAVrd7jENVzUIbsqq/rV4bGG2ltABj5fem2 kgeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123si3038409pfu.375.2018.02.19.14.03.09; Mon, 19 Feb 2018 14:03:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbeBSWCV (ORCPT + 99 others); Mon, 19 Feb 2018 17:02:21 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51704 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932089AbeBSWCU (ORCPT ); Mon, 19 Feb 2018 17:02:20 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44B3E7D85D; Mon, 19 Feb 2018 22:02:20 +0000 (UTC) Received: from treble (ovpn-120-38.rdu2.redhat.com [10.10.120.38]) by smtp.corp.redhat.com (Postfix) with SMTP id D6857213AEE2; Mon, 19 Feb 2018 22:02:19 +0000 (UTC) Date: Mon, 19 Feb 2018 16:02:19 -0600 From: Josh Poimboeuf To: Borislav Petkov Cc: X86 ML , Peter Zijlstra , Andy Lutomirski , LKML Subject: Re: [PATCH 3/5] x86/dumpstack: Improve opcodes dumping in the Code: section Message-ID: <20180219220219.lrnt2y6pcb7qyx4q@treble> References: <20180219202826.19797-1-bp@alien8.de> <20180219202826.19797-4-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180219202826.19797-4-bp@alien8.de> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 19 Feb 2018 22:02:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 19 Feb 2018 22:02:20 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 19, 2018 at 09:28:24PM +0100, Borislav Petkov wrote: > bool in_task_stack(unsigned long *stack, struct task_struct *task, > @@ -358,8 +362,8 @@ void die(const char *str, struct pt_regs *regs, long err) > > static int __init code_bytes_setup(char *s) > { > - ssize_t ret; > unsigned long val; > + ssize_t ret; > > if (!s) > return -EINVAL; > @@ -372,35 +376,37 @@ static int __init code_bytes_setup(char *s) > if (code_bytes > 8192) > code_bytes = 8192; > > + if (code_bytes > OPCODE_BUFSIZE) { > + u8 *new_buf = kzalloc(code_bytes, GFP_KERNEL); > + if (!new_buf) > + return -EINVAL; S/EINVAL/ENOMEM/ ? Otherwise the code looks good to me, and I like the new feature. -- Josh