Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2154359imm; Sat, 6 Oct 2018 20:39:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BqXHBgO9RAe23h81BxNafhADpHS32r6KBQJd1+nAvZGmkI/V2NFaYh0zEgLeDF1EibrFB X-Received: by 2002:a17:902:3143:: with SMTP id w61-v6mr18417221plb.85.1538883550635; Sat, 06 Oct 2018 20:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538883550; cv=none; d=google.com; s=arc-20160816; b=0xiCjmQZ9R7aFUZ6oG1rY/C+IRtKAHwJu4TJEKl1Q70UmcLN7jnXzsv0Wmf0qH52tP yuVRPbTNpbMOhbM6qwOL1V9YzwK6SyobLgHSpc4tcQT7mB2bg4MQYisGyIWRBJ9E5ZYR DTPK/zA3OlQiqoW9p9VrT96j7jhwjeEji77uV/mUWzu3/mra055yuO4N10fL8iM0M2uz 8VmY5NxOrd/Qx7213ikOMTr5RwfofOvW7Yt7Y9hJrLVmZ0NVPHlKlR8KTy6ri+4uA5cQ ZEZ9GN3XFp7MkIY/hB7w/lleMnnTXfGzVaDg/MJrCzejbJ6yY2NWEY3RzcEuNDKfq4TT MM5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=FKbyQDIuOo82FOPbYkMHRWwyIlwcH0iQV/DmiE6BUQI=; b=GGSb43EClaGJesMIXNWE5XI/WGZ+07v8JNUc9ed2DJP4lkxlTA/FZxPte7n/4M4SwU tLC/tXBRYlJZxE35lFYUPmqksYSPhls38nA8UPp6V1znH85Hjc76DTyPjwYjSjQ14IZm 3ga+coG7+6ZJ5FL1SbtKPDprqttWTbGx7omJwjNH2yZwkhm6N5UjmrY49WrBY5Li5Akg uycwMnC9FpoA5Y4BVf0iT+7Ohpj2IIlqbMRwabBTtK0yO8axKdTi/33xUF+cRXULH6oY KvCrD4eoO2GuufzThjnL/wp1yT/82K5ILzAo/JAbogRC3H8pThAZ2+UZLR1f+bLgAM0d iCaw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g74-v6si9586236pfe.4.2018.10.06.20.38.55; Sat, 06 Oct 2018 20:39:10 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbeJGKo2 (ORCPT + 99 others); Sun, 7 Oct 2018 06:44:28 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47557 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbeJGKo1 (ORCPT ); Sun, 7 Oct 2018 06:44:27 -0400 Received: from carbon-x1.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w973bt80047549 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 6 Oct 2018 20:37:55 -0700 Received: from carbon-x1.hos.anvin.org (localhost [127.0.0.1]) by carbon-x1.hos.anvin.org (8.15.2/8.15.2) with ESMTP id w973bneD224510; Sat, 6 Oct 2018 20:37:49 -0700 Received: (from hpa@localhost) by carbon-x1.hos.anvin.org (8.15.2/8.15.2/Submit) id w973bn4l224508; Sat, 6 Oct 2018 20:37:49 -0700 From: "H. Peter Anvin" To: linux-kernel@vger.kernel.org Cc: "H. Peter Anvin (Intel)" , Greg Kroah-Hartman , Jiri Slaby , Al Viro , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Gleixner , Kate Stewart , Philippe Ombredanne , Eugene Syromiatnikov , linux-alpha@vger.kernel.org, linux-serial@vger.kernel.org, Johan Hovold , Alan Cox , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , stable@vger.kernel.org Subject: [PATCH stable 0/2] termios: Alpha BOTHER/IBSHIFT, tty_baudrate fix Date: Sat, 6 Oct 2018 20:37:46 -0700 Message-Id: <20181007033748.224461-1-hpa@zytor.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H. Peter Anvin (Intel)" It turns out that Alpha is the only architecture that never implemented BOTHER and IBSHIFT, which is otherwise ages old. This is one thing that has held up glibc support for this feature (all other architectures have supported these for about a decade, at least before the current 3.2 glibc cutoff.) Furthermore, in the process of dealing with this, I discovered that the current code in tty_baudrate.c can read past the end of the baud_table[] on Alpha and PowerPC. The second patch in this series fixes that, but it also cleans up the code substantially by auto-generating the table and, since all architectures now have them, removing all conditionals for BOTHER and IBSHIFT existing. Tagging for stable because these are concrete problems. I have a much bigger update in process, nearly done, which will clean up a lot of duplicated code and make the uapi headers usable for libc, but that is not critical on the same level. Tested on x86, compile-tested on Alpha. Signed-off-by: H. Peter Anvin (Intel) Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Al Viro Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Greg Kroah-Hartman Cc: Eugene Syromiatnikov Cc: Cc: Cc: Johan Hovold Cc: Alan Cox Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: --- arch/alpha/include/asm/termios.h | 8 +- arch/alpha/include/uapi/asm/ioctls.h | 5 + arch/alpha/include/uapi/asm/termbits.h | 17 +++ drivers/tty/.gitignore | 1 + drivers/tty/Makefile | 16 +++ drivers/tty/bmacros.c | 2 + drivers/tty/tty_baudrate.c | 190 +++++++++++++-------------------- 7 files changed, 122 insertions(+), 117 deletions(-)