what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Android maxdsm Driver Kernel Information Disclosure

Android maxdsm Driver Kernel Information Disclosure
Posted Jan 5, 2017
Authored by Google Security Research, laginimaineb

Android suffers from a kernel information disclosure vulnerability in the maxdsm_read function in the maxdsm driver.

tags | advisory, kernel, info disclosure
SHA-256 | 9fe66c9d127d43c00ea4b0116eb9c917474d5e6376dce48720e7bba86ceeebdb

Android maxdsm Driver Kernel Information Disclosure

Change Mirror Download
Android: Kernel information disclosure in "maxdsm_read" 




The "maxdsm" driver exposes several character devices which can be used to control and calibrate the device. One such device is the "control device", exposed under: "/dev/dsm_ctrl_dev".

The character device provides several file operations, including a "read" operation, which is implemented using the function "maxdsm_read". The code for the "maxdsm_read" function is as follows:

1. static ssize_t maxdsm_read(struct file *filep, char __user *buf,
2. size_t count, loff_t *ppos)
3. {
4. int ret;
5.
6. mutex_lock(&dsm_fs_lock);
7.
8. maxdsm_read_all();
9.
10. /* copy params to user */
11. ret = copy_to_user(buf, maxdsm.param, count);
12. if (ret)
13. pr_err("%s: copy_to_user failed - %d\n", __func__, ret);
14.
15. mutex_unlock(&dsm_fs_lock);
16.
17. return ret;
18. }

This function fails to validate the "count" argument, passed in by the caller. This means that calling "read" with a large count (i.e., larger than maxdsm.param_size) would copy in additional bytes which reside after the maxdsm.param buffer.

I've statically verified this issue on an SM-G935F device, using the open-source kernel package "SM-G935F_MM_Opensource".

The "/dev/dsm_ctrl_dev" file is owned by root, and has an SELinux context of "u:object_r:device:s0".

According to the default SELinux rules as present on the SM-G935F (version XXS1APG3), the following contexts may access these files:
allow icd device : file { write append open } ;
allow system_app device : dir { read getattr search open } ;
allow device device : filesystem associate ;
allow kiesexe device : file { ioctl read getattr lock open } ;
allow oneseg_mw device : sock_file write ;
allow llk_untrusted_app device : sock_file { ioctl read write getattr lock append open } ;
allow ddexe device : file { ioctl read getattr lock open } ;
allow ueventd device : file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow qti_init_shell device : file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow radio device : sock_file write ;
allow init device : chr_file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow init device : file { ioctl read write create getattr setattr lock relabelfrom append unlink rename open } ;
allow rild device : file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow nfc device : lnk_file read ;
allow mpdecision device : sock_file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow charge device : dir { read write open } ;
allow vold device : chr_file { ioctl create setattr lock append link rename execute } ;
allow rild device : lnk_file { create unlink } ;
allow rtcc device : dir { ioctl read write getattr add_name remove_name search open } ;
allow dhcp device : file { ioctl read getattr lock open } ;
allow debuggerd device : dir { write add_name remove_name } ;
allow domain device : dir search ;
allow bootchecker device : sock_file write ;
allow rild device : dir { ioctl read write getattr add_name remove_name search open } ;
allow ffu device : dir { ioctl read write getattr add_name remove_name search open } ;
allow felica_app device : dir { read write setattr open } ;
allow vold device : dir { ioctl read write create getattr setattr rename add_name remove_name reparent search rmdir open } ;
allow ext_symlink device : dir { write add_name remove_name } ;
allow domain device : file read ;
allow servicemanager device : file { ioctl read getattr lock open } ;
allow init device : lnk_file unlink ;
allow sdcardd device : dir { ioctl read write getattr add_name remove_name search open } ;
allow llk_untrusted_app device : fifo_file { ioctl read write getattr lock append open } ;
allow bugreport device : sock_file write ;
allow wpa device : file { ioctl read getattr lock open } ;
allow kernel device : chr_file { create getattr setattr unlink } ;
allow kernel device : dir { ioctl read write create getattr setattr rename add_name remove_name reparent search rmdir open } ;
allow system_server device : sock_file { ioctl read write getattr lock append open } ;
allow tbased device : dir { write create add_name } ;
allow qti_init_shell device : dir { ioctl read write create getattr setattr rename add_name remove_name reparent search rmdir open } ;
allow untrusteddomain device : dir { read write setattr open } ;
allow system_app device : file { ioctl read getattr lock open } ;
allow cnd device : sock_file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow ext_symlink device : lnk_file { create unlink } ;
allow thermal-engine device : sock_file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow mpdecision device : dir { ioctl read write getattr add_name remove_name search open } ;
allow qlogd device : dir { ioctl read getattr search open } ;
allow kernel device : blk_file { ioctl read write create getattr setattr lock append unlink rename open } ;
allow p2p_supplicant device : file { ioctl read getattr lock open } ;
allow slideshow device : dir { ioctl read getattr search open } ;
allow charge device : chr_file { create unlink } ;
allow ueventd device : chr_file { ioctl read write getattr lock append open } ;
allow healthd device : dir { write add_name remove_name search open } ;
allow fsck device : dir write ;
allow mmb_mw device : sock_file write ;
allow init device : dir { write relabelto mounton add_name remove_name } ;
allow cbd device : dir { ioctl read write getattr add_name remove_name search open } ;
allow tee device : dir { ioctl read getattr search open } ;
allow system_app device : sock_file write ;
allow ueventd device : lnk_file { ioctl read getattr lock unlink link rename open } ;
allow system_server device : dir { ioctl read getattr search open } ;
allow dumpstate device : sock_file write ;

This bug is subject to a 90 day disclosure deadline. If 90 days elapse
without a broadly available patch, then the bug report will automatically
become visible to the public.




Found by: laginimaineb

Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    0 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close