]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
speakup: Fix 8bit characters from direct synth
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 4 Feb 2024 15:57:36 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:28 +0000 (15:28 +0200)
commitcc3519b818c118d3b388fe9e11eb5dfbea81bc2b
tree6b00769cb134366f6f666f459e6cc0734a452ce7
parenta973ef25f144fed91a501502db0bcb70a6614647
speakup: Fix 8bit characters from direct synth

[ Upstream commit b6c8dafc9d86eb77e502bb018ec4105e8d2fbf78 ]

When userland echoes 8bit characters to /dev/synth with e.g.

echo -e '\xe9' > /dev/synth

synth_write would get characters beyond 0x7f, and thus negative when
char is signed.  When given to synth_buffer_add which takes a u16, this
would sign-extend and produce a U+ffxy character rather than U+xy.
Users thus get garbled text instead of accents in their output.

Let's fix this by making sure that we read unsigned characters.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Fixes: 89fc2ae80bb1 ("speakup: extend synth buffer to 16bit unicode characters")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240204155736.2oh4ot7tiaa2wpbh@begin
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/accessibility/speakup/synth.c