Due to changes in BlueZ added to fix CVE-2023-45866, the PS3 controllers won't pair/work anymore with BlueZ.
Since the path consist in only one change to default option (ClassicBondedOnly default changed, see [1]), it's been quickly added by all distros [2], [3].
This has already been reported in the forums and fixed (for Buster) by downgrading the `bluez` package. The same fix cannot be applied to current distros, so we can switch back the option to the way it works with PS3 controllers.
NOTE:
* while technically this make BlueZ vulnerable to CVE-2023-45866, the exploit mentioned works IIF BlueZ is set to 'discoverable' mode.
However, this mode is set only during discoveries, which in RetroPie means just the pairing dialog - I think the risk for a real break-in through the vulnerability described is very low. See [4] for an explanation of the conditions needed to exploit it on BlueZ and a PoC (which didn't work for me, despite having the vulnerable config in place).
* the configuration is set-up only when a PS3 pairing attempt is made.
* when removing a device, the vulnerable configuration will also be removed if no more PS3 paired devices are left.
[1] https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input?id=25a471a83e02e1effb15d5a488b3f0085eaeb675
[2] https://ubuntu.com/security/CVE-2023-45866
[3] https://security-tracker.debian.org/tracker/CVE-2023-45866
[4] https://github.com/marcnewlin/hi_my_name_is_keyboard?tab=readme-ov-file#linux-keystroke-injection
Updated the dependencies and scripts for python3:
* `python-dbus` no longer exists in Debian 11 'bullseye' or Ubuntu > 20.04, installl the `python3` version
* `python-gobject` has been superseeded by `python(3)-gi`, the current package is just a transitional package that pulls
`python-gi` and the old `python-gobject-2` (deprecated). Update the dependencies and the scripts to use the new package.
* set python3 as interpreter for the helper scripts. Fixed the dict syntax for getting items
I made some changes before to hide previously registered devices from the connect menu, to make it
easier when dealing with multiple devices of the same name. However due to the way bluetoothctl works,
previously "seen" devices are added to the system, meaning devices that are not paired are registered and cached,
and then won't be shown again.
This changeset addresses the following:
Only actually paired devices will be hidden from the register and connect menu
New functions list_paired and list_connected have been added
Switched to use bt-device to check for connected devices for consistency. Private function handles
grepping for Paired or Connected via bt-device --info
display_active_and_registered function renamed to simpler status and reworked to use the new functions.
It outputs to console - the GUI menu just calls this and then outputs to a dialog menu - making this now
a more useful commandline function
remove_device shows all registered devices, even ones seen before. These previously seen devices show
up when scanning so we still want to be able to remove them. I have adjusted it though so paired devices are
shown first, followed by any known devices.
* running RetroPie-Setup on boot isn't efficient / it should work without RetroPie-Setup present.
* running it as root on boot causes /opt/retropie/configs/all to be chowned to root due to setupDirectories call
Before when looking for devices to pair with, previously registered devices could be shown
which can make it confusing with multiple gamepads with the same name as to which to add
* Installs multi-instance systemd service, triggered via udev
rules matching supported Sixaxis-compatible pads
* Configure fuzz on analog axes to mitigate erratic resting state values
* When connecting via Bluetooth, implement idle disconnect based on event
activity (needed due to BlueZ's sixaxis plugin not respecting the
IdleTimeout setting).
Ensure that bluetoothctl will never cause the script to hang due to
infinitely repeating status change messages.
Also reduce timeout to 15 seconds and clarify DualShock instructions;
the PS button needs to be pressed if the controller is still scanning
during cable connect to ensure it binds to the USB connection.
All changes are compatible with Raspbian stretch's default
BlueZ version.
bluez_cmd_bluetooth:
* enable default-agent during general scan
* fix compatibility with BlueZ 5.50-1 userspace tools
* improved reliability when sending multiple commands
sixaxis:
* ensure both authorization & trust is performed to account for
different BlueZ behaviour between versions
* force-disconnect Bluetooth connection upon first registration to
avoid controller hang caused by USB input claim conflict
general:
* increase scan time to 20 seconds
* silence sixad messages
Add information to the default Bluetooth scanning prompt when the hid-sony driver is loaded,
and reply to Bluetooth authorization prompt to allow successful pairing.
* Remove obsolete information that driver breaks Bluetooth and replace
with warning that Bluetooth pairing works in RetroPie menu, but cannot
be guaranteed elsewhere.
* Add notice after exiting Bluetooth menu (only when sixad is running)
informing users to re-pair controller, to hopefully reduce confusion.
Re-enable bluetoooth stack in Bluetooth dialog menu, and restart
sixad daemon upon exit.
This allows standard BT device pair/unpair management with DS3
controller fully working in-menu. The only drawback is that
your PS3 controller will turn off upon exiting the menu due to the
daemon restart.
* deal with RequestConfirmation responses - ignore errors from the python script and just check connection as it seems to pair and connect despite reporting problems. may help #1611
* add autoconf.cfg parameter 8bitdo_hack (default 1) to decide whether to add the offset to the inputs for retroarch - which is required on the older firmware
* make sure autoconf.cfg is owned by $user - it would be created as root previously
* add setAutoConf function
* cleanup retroarch config generation code
* ability to connect to all registered devices from the bluetooth module
* optional systemctl service that will connect to all registered devices on boot
* rp_module_menus is no more - instead use rp_module_section with one of
- core (core packages)
- main (main packages - which will be installed by default in the image)
- opt (optional packages)
- exp (experimental packages)
- driver (driver packages)
- config (configuration packages / tools)
* The setup menu organises the data based on the above sections. more could be added in the future if needed. Packages (internally modules), can be added / configured / removed individually, or as entire sections.
* The setup menu will automatically detect if a binary is available to be installed. the nobin flag is no longer needed. modules that install directly from binary via aptInstall or via a prebuilt binary need to use an install_bin_ function instead of install_
* rp_module_section of type "config" will have the "gui_" function called first if it's available, otherwise a standard depends/sources/build/install/configure will be called
* configure is no longer used for "gui" configuration function - use gui_ instead. Had already started to move to this before, but now it is required.