From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH stable v2 1/2] arch/alpha, termios: implement BOTHER, IBSHIFT and termios2 Date: Mon, 8 Oct 2018 17:38:40 +0200 Message-ID: <20181008153840.GD3332@localhost> References: <20181008040620.1248277-1-hpa@zytor.com> <20181008040620.1248277-2-hpa@zytor.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3JUtAQSBvnjsHhi7rzPs7uiH357XflzdvnRYKkxs2FA=; b=CzhGkfS7sr5utty3opPM2ISYy6qslUxUacgK4yonPZMisnVW/2p06EECzsZ6L6A6ge j1LZwxJ87zLj4x4drX29pz0GFEoRH9lmWMtmhodJA3cpRljnpiRiIiw8+LWo1kkpsIM1 Es4cOtZKAhycJjYIyh/J33Wa6hYqz8Uz9J1i+u2TEqhTFOl+gDPJ1qIVWENXDVwpoQLD i3FJWWMkKCf7bOHUQGxhTqMnhSud8GudfNKu1l68D0Z1V1gt3ggGHdACKdX+2SbB/kFM 2R+TeAd1bS9/cbLIMf2/vK/2eGMKv6siiRmZdajG4T9Vcxduq0ZpiJ0CktKWQkWDBHGQ Jxvg== Content-Disposition: inline In-Reply-To: <20181008040620.1248277-2-hpa@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Tobias Klausmann , 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 , stable@vger.kernel.org On Sun, Oct 07, 2018 at 09:06:19PM -0700, H. Peter Anvin wrote: > From: "H. Peter Anvin (Intel)" > > Alpha has had c_ispeed and c_ospeed, but still set speeds in c_cflags > using arbitrary flags. Because BOTHER is not defined, the general > Linux code doesn't allow setting arbitrary baud rates, and because > CBAUDEX == 0, we can have an array overrun of the baud_rate[] table in > drivers/tty/tty_baudrate.c if (c_cflags & CBAUD) == 037. > > Resolve both problems by #defining BOTHER to 037 on Alpha. > > However, userspace still needs to know if setting BOTHER is actually > safe given legacy kernels (does anyone actually care about that on > Alpha anymore?), so enable the TCGETS2/TCSETS*2 ioctls on Alpha, even > though they use the same structure. Define struct termios2 just for > compatibility; it is the exact same structure as struct termios. In a > future patchset, this will be cleaned up so the uapi headers are > usable from libc. Is this really needed? By defining BOTHER (and IBSHIFT which you forgot to mention here) you are enabling arbitrary rates also through TCSETS on alpha, right? Johan