Linux 5.14.18
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.14.18 kernel.
All users of the 5.14 kernel series must upgrade.
The updated 5.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.14.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/x86/kvm/ioapic.c | 2 arch/x86/kvm/ioapic.h | 4 - arch/x86/kvm/mmu/spte.h | 7 - drivers/android/binder.c | 41 ++++------- drivers/android/binder_internal.h | 4 + drivers/comedi/drivers/dt9812.c | 115 +++++++++++++++++++++++-------- drivers/comedi/drivers/ni_usb6501.c | 10 ++ drivers/comedi/drivers/vmk80xx.c | 28 ++++--- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 drivers/staging/media/ipu3/ipu3-css-fw.c | 7 - drivers/staging/media/ipu3/ipu3-css-fw.h | 2 drivers/staging/rtl8192u/r8192U_core.c | 18 ++-- drivers/staging/rtl8712/usb_intf.c | 4 - drivers/staging/rtl8712/usb_ops_linux.c | 2 drivers/usb/gadget/udc/Kconfig | 1 drivers/usb/host/ehci-hcd.c | 11 ++ drivers/usb/host/ehci-platform.c | 6 + drivers/usb/host/ehci.h | 1 drivers/usb/musb/musb_gadget.c | 4 - drivers/usb/storage/unusual_devs.h | 10 ++ fs/isofs/inode.c | 2 fs/proc/base.c | 19 ++--- include/linux/lsm_hook_defs.h | 14 +-- include/linux/lsm_hooks.h | 14 +-- include/linux/security.h | 33 +++++--- security/security.c | 14 +-- security/selinux/hooks.c | 48 +++--------- sound/core/pcm_native.c | 9 +- sound/pci/cs46xx/cs46xx_lib.c | 30 ++------ 30 files changed, 266 insertions(+), 198 deletions(-)
Geert Uytterhoeven (1):
usb: gadget: Mark USB_FSL_QE broken on 64-bit
Greg Kroah-Hartman (1):
Linux 5.14.18
Gustavo A. R. Silva (1):
media: staging/intel-ipu3: css: Fix wrong size comparison imgu_css_fw_init
James Buren (1):
usb-storage: Add compatibility quirk flags for iODD 2531/2541
Jan Kara (1):
isofs: Fix out of bound access for corrupted isofs image
Johan Hovold (8):
comedi: dt9812: fix DMA buffers on stack
comedi: ni_usb6501: fix NULL-deref in command paths
comedi: vmk80xx: fix transfer-buffer overflows
comedi: vmk80xx: fix bulk-buffer overflow
comedi: vmk80xx: fix bulk and interrupt message timeouts
staging: r8712u: fix control-message timeout
staging: rtl8192u: fix control-message timeouts
rsi: fix control-message timeout
Juergen Gross (1):
Revert "x86/kvm: fix vcpu-id indexed array sizes"
Kees Cook (1):
Revert "proc/wchan: use printk format instead of lookup_symbol_name()"
Neal Liu (1):
usb: ehci: handshake CMD_RUN instead of STS_HALT
Paolo Bonzini (1):
KVM: x86: avoid warning with -Wbitwise-instead-of-logical
Pavel Skripkin (1):
staging: rtl8712: fix use-after-free in rtl8712_dl_fw
Takashi Iwai (2):
ALSA: pcm: Check mmap capability of runtime dma buffer at first
ALSA: pci: cs46xx: Fix set up buffer type properly
Todd Kjos (4):
binder: use euid from cred instead of using task
binder: use cred instead of task for selinux checks
binder: use cred instead of task for getsecid
binder: don't detect sender/target during buffer cleanup
Viraj Shah (1):
usb: musb: Balance list entry in musb_gadget_queue
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 14 -SUBLEVEL = 17 +SUBLEVEL = 18 EXTRAVERSION = NAME = Opossums on Parade
arch/x86/kvm/ioapic.c +1 -1
@@ -96,7 +96,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic,static void rtc_irq_eoi_tracking_reset (struct kvm_ioapic *ioapic) { ioapic->rtc_status.pending_eoi =0 ; -bitmap_zero (ioapic->rtc_status.dest_map.map,KVM_MAX_VCPU_ID +1 ); +bitmap_zero (ioapic->rtc_status.dest_map.map,KVM_MAX_VCPU_ID ); }static void kvm_rtc_eoi_tracking_restore_all (struct kvm_ioapic *ioapic);
arch/x86/kvm/ioapic.h +2 -2
@@ -43,13 +43,13 @@ struct kvm_vcpu;struct dest_map {/* vcpu bitmap where IRQ has been sent */ - DECLARE_BITMAP(map, KVM_MAX_VCPU_ID + 1); + DECLARE_BITMAP(map, KVM_MAX_VCPU_ID);/* * Vector sent to a given vcpu, only valid when * the vcpu's bit in map is set */ -u8 vectors[KVM_MAX_VCPU_ID +1 ]; +u8 vectors[KVM_MAX_VCPU_ID ]; };
arch/x86/kvm/mmu/spte.h +1 -6
@@ -310,12 +310,7 @@ static inline bool __is_bad_mt_xwr(struct rsvd_bits_validate *rsvd_check, static __always_inline bool is_rsvd_spte(struct rsvd_bits_validate *rsvd_check,u64 spte,int level) { -/* -* Use a bitwise-OR instead of a logical-OR to aggregate the reserved -* bits and EPT's invalid memtype/XWR checks to avoid an extra Jcc -* (this is extremely unlikely to be short-circuited as true). -*/ -return __is_bad_mt_xwr (rsvd_check, spte) | +return __is_bad_mt_xwr (rsvd_check, spte) ||__is_rsvd_bits_set (rsvd_check, spte, level); }
drivers/android/binder.c +17 -24
138 lines not on this page · raw message
drivers/android/binder_internal.h +4 -0
@@ -364,6 +364,9 @@ struct binder_ref {* (invariant after initialized) * @tsk task_struct for group_leader of process * (invariant after initialized) +* @cred struct cred associated with the `struct file` +* in binder_open() +* (invariant after initialized) * @deferred_work_node: element for binder_deferred_list * (protected by binder_deferred_lock) * @deferred_work: bitmap of deferred work to perform
@@ -426,6 +429,7 @@ struct binder_proc {struct list_head waiting_threads;int pid;struct task_struct *tsk; +const struct cred *cred;struct hlist_node deferred_work_node;int deferred_work;int outstanding_txns;
drivers/comedi/drivers/dt9812.c +86 -29
172 lines not on this page · raw message
drivers/comedi/drivers/ni_usb6501.c +10 -0
@@ -144,6 +144,10 @@ static const u8 READ_COUNTER_RESPONSE[] = {0x00, 0x01, 0x00, 0x10,0x00 ,0x00 ,0x00 ,0x02 , 0x00, 0x00, 0x00, 0x00}; +/* Largest supported packets */ +static const size_t TX_MAX_SIZE =sizeof (SET_PORT_DIR_REQUEST ); +static const size_t RX_MAX_SIZE =sizeof (READ_PORT_RESPONSE ); +enum commands {READ_PORT , WRITE_PORT,
@@ -501,6 +505,12 @@ static int ni6501_find_endpoints(struct comedi_device *dev)if (!devpriv->ep_rx || !devpriv->ep_tx)return -ENODEV ; +if (usb_endpoint_maxp (devpriv->ep_rx) <RX_MAX_SIZE ) +return -ENODEV ; + +if (usb_endpoint_maxp (devpriv->ep_tx) <TX_MAX_SIZE ) +return -ENODEV ; +return 0 ; }
drivers/comedi/drivers/vmk80xx.c +15 -13
@@ -90,6 +90,9 @@ enum {#define IC3_VERSION BIT(0)#define IC6_VERSION BIT(1) +#define MIN_BUF_SIZE 64 +#define PACKET_TIMEOUT 10000/* ms */ +enum vmk80xx_model {VMK8055_MODEL ,VMK8061_MODEL
@@ -157,22 +160,21 @@ static void vmk80xx_do_bulk_msg(struct comedi_device *dev)__u8 rx_addr;unsigned int tx_pipe;unsigned int rx_pipe; -size_t size; +size_t tx_size; +size_t rx_size; tx_addr = devpriv->ep_tx->bEndpointAddress; rx_addr = devpriv->ep_rx->bEndpointAddress; tx_pipe =usb_sndbulkpipe (usb, tx_addr); rx_pipe =usb_rcvbulkpipe (usb, rx_addr); + tx_size =usb_endpoint_maxp (devpriv->ep_tx); + rx_size =usb_endpoint_maxp (devpriv->ep_rx); -/* -* The max packet size attributes of the K8061 -* input/output endpoints are identical -*/ - size =usb_endpoint_maxp (devpriv->ep_tx); +usb_bulk_msg (usb, tx_pipe, devpriv->usb_tx_buf, tx_size,NULL , +PACKET_TIMEOUT ); -usb_bulk_msg (usb, tx_pipe, devpriv->usb_tx_buf, - size,NULL , devpriv->ep_tx->bInterval); -usb_bulk_msg (usb, rx_pipe, devpriv->usb_rx_buf, size,NULL ,HZ *10 ); +usb_bulk_msg (usb, rx_pipe, devpriv->usb_rx_buf, rx_size,NULL , +PACKET_TIMEOUT ); }static int vmk80xx_read_packet (struct comedi_device *dev)
@@ -191,7 +193,7 @@ static int vmk80xx_read_packet(struct comedi_device *dev) pipe =usb_rcvintpipe (usb, ep->bEndpointAddress);return usb_interrupt_msg (usb, pipe, devpriv->usb_rx_buf,usb_endpoint_maxp (ep),NULL , -HZ *10 ); +PACKET_TIMEOUT ); }static int vmk80xx_write_packet (struct comedi_device *dev,int cmd)
@@ -212,7 +214,7 @@ static int vmk80xx_write_packet(struct comedi_device *dev, int cmd) pipe =usb_sndintpipe (usb, ep->bEndpointAddress);return usb_interrupt_msg (usb, pipe, devpriv->usb_tx_buf,usb_endpoint_maxp (ep),NULL , -HZ *10 ); +PACKET_TIMEOUT ); }static int vmk80xx_reset_device (struct comedi_device *dev)
@@ -678,12 +680,12 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev)struct vmk80xx_private *devpriv = dev->private;size_t size; - size =usb_endpoint_maxp (devpriv->ep_rx); + size =max (usb_endpoint_maxp (devpriv->ep_rx),MIN_BUF_SIZE ); devpriv->usb_rx_buf =kzalloc (size,GFP_KERNEL );if (!devpriv->usb_rx_buf)return -ENOMEM ; - size =usb_endpoint_maxp (devpriv->ep_tx); + size =max (usb_endpoint_maxp (devpriv->ep_rx),MIN_BUF_SIZE ); devpriv->usb_tx_buf =kzalloc (size,GFP_KERNEL );if (!devpriv->usb_tx_buf)return -ENOMEM ;
drivers/net/wireless/rsi/rsi_91x_usb.c +1 -1
@@ -61,7 +61,7 @@ static int rsi_usb_card_write(struct rsi_hw *adapter, (void *)seg, (int )len, &transfer, - HZ * 5); + USB_CTRL_SET_TIMEOUT);if (status <0 ) { rsi_dbg(ERR_ZONE,
drivers/staging/media/ipu3/ipu3-css-fw.c +3 -4
@@ -124,12 +124,11 @@ int imgu_css_fw_init(struct imgu_css *css)/* Check and display fw header info */ css->fwp = (struct imgu_fw_header *)css->fw->data; -if (css->fw->size <sizeof (struct imgu_fw_header *) || +if (css->fw->size <struct_size (css->fwp, binary_header,1 ) || css->fwp->file_header.h_size !=sizeof (struct imgu_fw_bi_file_h )) goto bad_fw; -if (sizeof (struct imgu_fw_bi_file_h ) + - css->fwp->file_header.binary_nr *sizeof (struct imgu_fw_info ) > - css->fw->size) +if (struct_size (css->fwp, binary_header, + css->fwp->file_header.binary_nr) > css->fw->size) goto bad_fw; dev_info(dev, "loaded firmware version %.64s, %u binaries, %zu bytes\n",
drivers/staging/media/ipu3/ipu3-css-fw.h +1 -1
@@ -171,7 +171,7 @@ struct imgu_fw_bi_file_h {struct imgu_fw_header {struct imgu_fw_bi_file_h file_header; -struct imgu_fw_info binary_header[1 ];/* binary_nr items */ +struct imgu_fw_info binary_header[];/* binary_nr items */ };/******************* Firmware functions *******************/
drivers/staging/rtl8192u/r8192U_core.c +9 -9
@@ -229,7 +229,7 @@ int write_nic_byte_E(struct net_device *dev, int indx, u8 data) status =usb_control_msg (udev,usb_sndctrlpipe (udev,0 ),RTL8187_REQ_SET_REGS ,RTL8187_REQT_WRITE , - indx |0xfe00 ,0 , usbdata,1 ,HZ /2 ); + indx |0xfe00 ,0 , usbdata,1 ,500 );kfree (usbdata);if (status <0 ) {
@@ -251,7 +251,7 @@ int read_nic_byte_E(struct net_device *dev, int indx, u8 *data) status =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8187_REQ_GET_REGS ,RTL8187_REQT_READ , - indx |0xfe00 ,0 , usbdata,1 ,HZ /2 ); + indx |0xfe00 ,0 , usbdata,1 ,500 ); *data = *usbdata;kfree (usbdata);
@@ -279,7 +279,7 @@ int write_nic_byte(struct net_device *dev, int indx, u8 data) status =usb_control_msg (udev,usb_sndctrlpipe (udev,0 ),RTL8187_REQ_SET_REGS ,RTL8187_REQT_WRITE , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,1 ,HZ /2 ); + usbdata,1 ,500 );kfree (usbdata);if (status <0 ) {
@@ -305,7 +305,7 @@ int write_nic_word(struct net_device *dev, int indx, u16 data) status =usb_control_msg (udev,usb_sndctrlpipe (udev,0 ),RTL8187_REQ_SET_REGS ,RTL8187_REQT_WRITE , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,2 ,HZ /2 ); + usbdata,2 ,500 );kfree (usbdata);if (status <0 ) {
@@ -331,7 +331,7 @@ int write_nic_dword(struct net_device *dev, int indx, u32 data) status =usb_control_msg (udev,usb_sndctrlpipe (udev,0 ),RTL8187_REQ_SET_REGS ,RTL8187_REQT_WRITE , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,4 ,HZ /2 ); + usbdata,4 ,500 );kfree (usbdata);if (status <0 ) {
@@ -355,7 +355,7 @@ int read_nic_byte(struct net_device *dev, int indx, u8 *data) status =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8187_REQ_GET_REGS ,RTL8187_REQT_READ , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,1 ,HZ /2 ); + usbdata,1 ,500 ); *data = *usbdata;kfree (usbdata);
@@ -380,7 +380,7 @@ int read_nic_word(struct net_device *dev, int indx, u16 *data) status =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8187_REQ_GET_REGS ,RTL8187_REQT_READ , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,2 ,HZ /2 ); + usbdata,2 ,500 ); *data = *usbdata;kfree (usbdata);
@@ -404,7 +404,7 @@ static int read_nic_word_E(struct net_device *dev, int indx, u16 *data) status =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8187_REQ_GET_REGS ,RTL8187_REQT_READ , - indx |0xfe00 ,0 , usbdata,2 ,HZ /2 ); + indx |0xfe00 ,0 , usbdata,2 ,500 ); *data = *usbdata;kfree (usbdata);
@@ -430,7 +430,7 @@ int read_nic_dword(struct net_device *dev, int indx, u32 *data) status =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8187_REQ_GET_REGS ,RTL8187_REQT_READ , (indx &0xff ) |0xff00 , (indx >>8 ) &0x0f , - usbdata,4 ,HZ /2 ); + usbdata,4 ,500 ); *data = *usbdata;kfree (usbdata);
drivers/staging/rtl8712/usb_intf.c +2 -2
@@ -595,12 +595,12 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)/* never exit with a firmware callback pending */ wait_for_completion (&padapter->rtl8712_fw_ready); +if (pnetdev->reg_state !=NETREG_UNINITIALIZED ) +unregister_netdev (pnetdev);/* will call netdev_close() */ usb_set_intfdata (pusb_intf,NULL );release_firmware (padapter->fw);if (drvpriv.drv_registered) padapter->surprise_removed = true; -if (pnetdev->reg_state !=NETREG_UNINITIALIZED ) -unregister_netdev (pnetdev);/* will call netdev_close() */ r8712_flush_rwctrl_works (padapter);r8712_flush_led_works (padapter);udelay (1 );
drivers/staging/rtl8712/usb_ops_linux.c +1 -1
@@ -494,7 +494,7 @@ int r8712_usbctrl_vendorreq(struct intf_priv *pintfpriv, u8 request, u16 value,memcpy (pIo_buf, pdata, len); } status =usb_control_msg (udev, pipe, request, reqtype, value, index, - pIo_buf, len,HZ /2 ); + pIo_buf, len,500 );if (status >0 ) {/* Success this control transfer. */ if (requesttype ==0x01 ) {/* For Control read transfer, we have to copy the read
drivers/usb/gadget/udc/Kconfig +1 -0
@@ -330,6 +330,7 @@ config USB_AMD5536UDC config USB_FSL_QE tristate "Freescale QE/CPM USB Device Controller" depends on FSL_SOC && (QUICC_ENGINE || CPM) + depends on !64BIT || BROKEN help Some of Freescale PowerPC processors have a Full Speed QE/CPM2 USB controller, which support device mode with 4
drivers/usb/host/ehci-hcd.c +10 -1
@@ -634,7 +634,16 @@ static int ehci_run (struct usb_hcd *hcd)/* Wait until HC become operational */ ehci_readl (ehci, &ehci->regs->command);/* unblock posted writes */ msleep (5 ); - rc =ehci_handshake (ehci, &ehci->regs->status,STS_HALT ,0 ,100 *1000 ); + +/* For Aspeed, STS_HALT also depends on ASS/PSS status. +* Check CMD_RUN instead. +*/ +if (ehci->is_aspeed) + rc =ehci_handshake (ehci, &ehci->regs->command,CMD_RUN , +1 ,100 *1000 ); +else + rc =ehci_handshake (ehci, &ehci->regs->status,STS_HALT , +0 ,100 *1000 );up_write (&ehci_cf_port_reset_rwsem);
drivers/usb/host/ehci-platform.c +6 -0
@@ -297,6 +297,12 @@ static int ehci_platform_probe(struct platform_device *dev) "has-transaction-translator")) hcd->has_tt =1 ; +if (of_device_is_compatible (dev->dev.of_node, +"aspeed,ast2500-ehci" ) || +of_device_is_compatible (dev->dev.of_node, +"aspeed,ast2600-ehci" )) + ehci->is_aspeed =1 ; +if (soc_device_match (quirk_poll_match)) priv->quirk_poll = true;
drivers/usb/host/ehci.h +1 -0
@@ -219,6 +219,7 @@ struct ehci_hcd { /* one per controller */ unsigned need_oc_pp_cycle:1; /* MPC834X port power */ unsigned imx28_write_fix:1; /* For Freescale i.MX28 */ unsigned spurious_oc:1; + unsigned is_aspeed:1;/* required for usb32 quirk */ #define OHCI_CTRL_HCFS (3 << 6)
drivers/usb/musb/musb_gadget.c +3 -1
@@ -1247,9 +1247,11 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, status =musb_queue_resume_work (musb, musb_ep_restart_resume_work, request); -if (status <0 ) +if (status <0 ) {dev_err (musb->controller,"%s resume work: %i\n" , __func__, status); +list_del (&request->list); + } } unlock:
drivers/usb/storage/unusual_devs.h +10 -0
@@ -406,6 +406,16 @@ UNUSUAL_DEV( 0x04b8, 0x0602, 0x0110, 0x0110, "785EPX Storage", USB_SC_SCSI, USB_PR_BULK, NULL, US_FL_SINGLE_LUN), +/* +* Reported by James Buren <[email protected]> +* Virtual ISOs cannot be remounted if ejected while the device is locked +* Disable locking to mimic Windows behavior that bypasses the issue +*/ +UNUSUAL_DEV (0x04c5 ,0x2028 ,0x0001 ,0x0001 , +"iODD" , +"2531/2541" , + USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE), +/* * Not sure who reported this originally but * Pavel Machek <[email protected]> reported that the extra US_FL_SINGLE_LUN
fs/isofs/inode.c +2 -0
@@ -1322,6 +1322,8 @@ static int isofs_read_inode(struct inode *inode, int relocated) de = (struct iso_directory_record *) (bh->b_data + offset); de_len = *(unsigned char *) de; +if (de_len <sizeof (struct iso_directory_record )) + goto fail;if (offset + de_len > bufsize) {int frag1 = bufsize - offset;
fs/proc/base.c +11 -8
@@ -67,6 +67,7 @@#include <linux/mm.h> #include <linux/swap.h> #include <linux/rcupdate.h> +#include <linux/kallsyms.h> #include <linux/stacktrace.h> #include <linux/resource.h> #include <linux/module.h>
@@ -385,17 +386,19 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long wchan; +char symname[KSYM_NAME_LEN ]; -if (ptrace_may_access (task,PTRACE_MODE_READ_FSCREDS )) - wchan =get_wchan (task); -else - wchan =0 ; +if (!ptrace_may_access (task,PTRACE_MODE_READ_FSCREDS )) + goto print0; -if (wchan) -seq_printf (m,"%ps" , (void *) wchan); -else -seq_putc (m,'0' ); + wchan =get_wchan (task); +if (wchan && !lookup_symbol_name (wchan, symname)) { +seq_puts (m, symname); +return 0 ; + } +print0: +seq_putc (m,'0' );return 0 ; }#endif /* CONFIG_KALLSYMS */
include/linux/lsm_hook_defs.h +7 -7
@@ -26,13 +26,13 @@* #undef LSM_HOOK * }; */ -LSM_HOOK(int, 0, binder_set_context_mgr, struct task_struct *mgr) -LSM_HOOK(int, 0, binder_transaction, struct task_struct *from, - struct task_struct *to) -LSM_HOOK(int, 0, binder_transfer_binder, struct task_struct *from, - struct task_struct *to) -LSM_HOOK(int, 0, binder_transfer_file, struct task_struct *from, - struct task_struct *to, struct file *file) +LSM_HOOK(int, 0, binder_set_context_mgr, const struct cred *mgr) +LSM_HOOK(int, 0, binder_transaction, const struct cred *from, + const struct cred *to) +LSM_HOOK(int, 0, binder_transfer_binder, const struct cred *from, + const struct cred *to) +LSM_HOOK(int, 0, binder_transfer_file, const struct cred *from, + const struct cred *to, struct file *file) LSM_HOOK(int, 0, ptrace_access_check, struct task_struct *child, unsigned int mode) LSM_HOOK(int, 0, ptrace_traceme, struct task_struct *parent)
include/linux/lsm_hooks.h +7 -7
@@ -1313,22 +1313,22 @@* * @binder_set_context_mgr: * Check whether @mgr is allowed to be the binder context manager. -* @mgr contains the task_struct for the task being registered. +* @mgr contains the struct cred for the current binder process. * Return 0 if permission is granted. * @binder_transaction: * Check whether @from is allowed to invoke a binder transaction call * to @to. -* @from contains the task_struct for the sending task. -* @to contains the task_struct for the receiving task. +* @from contains the struct cred for the sending process. +* @to contains the struct cred for the receiving process. * @binder_transfer_binder: * Check whether @from is allowed to transfer a binder reference to @to. -* @from contains the task_struct for the sending task. -* @to contains the task_struct for the receiving task. +* @from contains the struct cred for the sending process. +* @to contains the struct cred for the receiving process. * @binder_transfer_file: * Check whether @from is allowed to transfer @file to @to. -* @from contains the task_struct for the sending task. +* @from contains the struct cred for the sending process. * @file contains the struct file being transferred. -* @to contains the task_struct for the receiving task. +* @to contains the struct cred for the receiving process. * * @ptrace_access_check: * Check permission before allowing the current process to trace the
include/linux/security.h +19 -14
@@ -258,13 +258,13 @@ extern int security_init(void);extern int early_security_init (void );/* Security operations */ -int security_binder_set_context_mgr (struct task_struct *mgr); -int security_binder_transaction (struct task_struct *from, -struct task_struct *to); -int security_binder_transfer_binder (struct task_struct *from, -struct task_struct *to); -int security_binder_transfer_file (struct task_struct *from, -struct task_struct *to,struct file *file); +int security_binder_set_context_mgr (const struct cred *mgr); +int security_binder_transaction (const struct cred *from, +const struct cred *to); +int security_binder_transfer_binder (const struct cred *from, +const struct cred *to); +int security_binder_transfer_file (const struct cred *from, +const struct cred *to,struct file *file);int security_ptrace_access_check (struct task_struct *child,unsigned int mode);int security_ptrace_traceme (struct task_struct *parent); int security_capget(struct task_struct *target,
@@ -508,25 +508,25 @@ static inline int early_security_init(void)return 0 ; } -static inline int security_binder_set_context_mgr (struct task_struct *mgr) +static inline int security_binder_set_context_mgr (const struct cred *mgr) {return 0 ; } -static inline int security_binder_transaction (struct task_struct *from, -struct task_struct *to) +static inline int security_binder_transaction (const struct cred *from, +const struct cred *to) {return 0 ; } -static inline int security_binder_transfer_binder (struct task_struct *from, -struct task_struct *to) +static inline int security_binder_transfer_binder (const struct cred *from, +const struct cred *to) {return 0 ; } -static inline int security_binder_transfer_file (struct task_struct *from, -struct task_struct *to, +static inline int security_binder_transfer_file (const struct cred *from, +const struct cred *to,struct file *file) {return 0 ;
@@ -1041,6 +1041,11 @@ static inline void security_transfer_creds(struct cred *new, { } +static inline void security_cred_getsecid (const struct cred *c,u32 *secid) +{ + *secid =0 ; +} +static inline int security_kernel_act_as (struct cred *cred,u32 secid) {return 0 ;
security/security.c +7 -7
@@ -747,25 +747,25 @@ static int lsm_superblock_alloc(struct super_block *sb)/* Security operations */ -int security_binder_set_context_mgr (struct task_struct *mgr) +int security_binder_set_context_mgr (const struct cred *mgr) {return call_int_hook (binder_set_context_mgr,0 , mgr); } -int security_binder_transaction (struct task_struct *from, -struct task_struct *to) +int security_binder_transaction (const struct cred *from, +const struct cred *to) {return call_int_hook (binder_transaction,0 , from, to); } -int security_binder_transfer_binder (struct task_struct *from, -struct task_struct *to) +int security_binder_transfer_binder (const struct cred *from, +const struct cred *to) {return call_int_hook (binder_transfer_binder,0 , from, to); } -int security_binder_transfer_file (struct task_struct *from, -struct task_struct *to,struct file *file) +int security_binder_transfer_file (const struct cred *from, +const struct cred *to,struct file *file) {return call_int_hook (binder_transfer_file,0 , from, to, file); }
security/selinux/hooks.c +13 -35
84 lines not on this page · raw message
sound/core/pcm_native.c +7 -2
@@ -243,13 +243,18 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,static bool hw_support_mmap (struct snd_pcm_substream *substream) { +struct snd_dma_buffer *dmabuf; +if (!(substream->runtime->hw.info &SNDRV_PCM_INFO_MMAP ))return false;if (substream->ops->mmap || substream->ops->page)return true; -switch (substream->dma_buffer.dev.type) { + dmabuf =snd_pcm_get_dma_buf (substream); +if (!dmabuf) + dmabuf = &substream->dma_buffer; +switch (dmabuf->dev.type) {case SNDRV_DMA_TYPE_UNKNOWN :/* we can't know the device, so just assume that the driver does * everything right
@@ -259,7 +264,7 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)case SNDRV_DMA_TYPE_VMALLOC :return true;default : -return dma_can_mmap (substream->dma_buffer.dev.dev); +return dma_can_mmap (dmabuf->dev.dev); } }
sound/pci/cs46xx/cs46xx_lib.c +8 -22
@@ -1121,9 +1121,7 @@ static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,if (params_periods (hw_params) ==CS46XX_FRAGS ) {if (runtime->dma_area != cpcm->hw_buf.area)snd_pcm_lib_free_pages (substream); - runtime->dma_area = cpcm->hw_buf.area; - runtime->dma_addr = cpcm->hw_buf.addr; - runtime->dma_bytes = cpcm->hw_buf.bytes; +snd_pcm_set_runtime_buffer (substream, &cpcm->hw_buf);#ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -1143,11 +1141,8 @@ static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,#endif }else { -if (runtime->dma_area == cpcm->hw_buf.area) { - runtime->dma_area =NULL ; - runtime->dma_addr =0 ; - runtime->dma_bytes =0 ; - } +if (runtime->dma_area == cpcm->hw_buf.area) +snd_pcm_set_runtime_buffer (substream,NULL ); err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 ) {#ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -1196,9 +1191,7 @@ static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)if (runtime->dma_area != cpcm->hw_buf.area)snd_pcm_lib_free_pages (substream); - runtime->dma_area =NULL ; - runtime->dma_addr =0 ; - runtime->dma_bytes =0 ; +snd_pcm_set_runtime_buffer (substream,NULL );return 0 ; }
@@ -1287,16 +1280,11 @@ static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream,if (runtime->periods ==CS46XX_FRAGS ) {if (runtime->dma_area != chip->capt.hw_buf.area)snd_pcm_lib_free_pages (substream); - runtime->dma_area = chip->capt.hw_buf.area; - runtime->dma_addr = chip->capt.hw_buf.addr; - runtime->dma_bytes = chip->capt.hw_buf.bytes; +snd_pcm_set_runtime_buffer (substream, &chip->capt.hw_buf); substream->ops = &snd_cs46xx_capture_ops; }else { -if (runtime->dma_area == chip->capt.hw_buf.area) { - runtime->dma_area =NULL ; - runtime->dma_addr =0 ; - runtime->dma_bytes =0 ; - } +if (runtime->dma_area == chip->capt.hw_buf.area) +snd_pcm_set_runtime_buffer (substream,NULL ); err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -1313,9 +1301,7 @@ static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream)if (runtime->dma_area != chip->capt.hw_buf.area)snd_pcm_lib_free_pages (substream); - runtime->dma_area =NULL ; - runtime->dma_addr =0 ; - runtime->dma_bytes =0 ; +snd_pcm_set_runtime_buffer (substream,NULL );return 0 ; }