lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1582720533.17520.26.camel@suse.com>
Date:   Wed, 26 Feb 2020 13:35:33 +0100
From:   Oliver Neukum <oneukum@...e.com>
To:     Vladimir Stankovic <vladimir.stankovic@...playlink.com>,
        Greg KH <gregkh@...uxfoundation.org>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        linux-usb <linux-usb@...r.kernel.org>,
        mausb-host-devel <mausb-host-devel@...playlink.com>
Subject: Re: [PATCH v2 5/8] usb: mausb_host: Introduce PAL processing

Am Mittwoch, den 26.02.2020, 09:58 +0000 schrieb Vladimir Stankovic

+int mausb_enqueue_event_from_user(u8 madev_addr, u16 num_of_events,
+                                 u16 num_of_completed)
+{
+       unsigned long flags;
+       struct mausb_device *dev;
+
+       spin_lock_irqsave(&mss.lock, flags);

You save the flags.

+       dev = mausb_get_dev_from_addr_unsafe(madev_addr);
+
+       if (!dev) {
+               spin_unlock_irqrestore(&mss.lock, flags);
+               return -EINVAL;
+       }
+
+       spin_lock_irqsave(&dev->num_of_user_events_lock, flags);

You overwrite the flags.

+       dev->num_of_user_events += num_of_events;
+       dev->num_of_completed_events += num_of_completed;
+       spin_unlock_irqrestore(&dev->num_of_user_events_lock, flags);

Your restore the flags.

+       queue_work(dev->workq, &dev->work);
+       spin_unlock_irqrestore(&mss.lock, flags);

You restore the overwritten flags.

This cannot be right.

	Regards
		Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ