···211211The :ref:`srgb` standard defines the colorspace used by most webcams212212and computer graphics. The default transfer function is213213``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is214214-``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full range.214214+``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited range.215215+216216+Note that the :ref:`sycc` standard specifies full range quantization,217217+however all current capture hardware supported by the kernel convert218218+R'G'B' to limited range Y'CbCr. So choosing full range as the default219219+would break how applications interpret the quantization range.220220+215221The chromaticities of the primary colors and the white reference are:216222217223···282276283277Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range284278[-0.5…0.5]. This transform is identical to one defined in SMPTE285285-170M/BT.601. The Y'CbCr quantization is full range.279279+170M/BT.601. The Y'CbCr quantization is limited range.286280287281288282.. _col-adobergb:···294288graphics that use the AdobeRGB colorspace. This is also known as the295289:ref:`oprgb` standard. The default transfer function is296290``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is297297-``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full298298-range. The chromaticities of the primary colors and the white reference299299-are:291291+``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited292292+range.300293294294+Note that the :ref:`oprgb` standard specifies full range quantization,295295+however all current capture hardware supported by the kernel convert296296+R'G'B' to limited range Y'CbCr. So choosing full range as the default297297+would break how applications interpret the quantization range.298298+299299+The chromaticities of the primary colors and the white reference are:301300302301303302.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|···355344356345Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range357346[-0.5…0.5]. This transform is identical to one defined in SMPTE358358-170M/BT.601. The Y'CbCr quantization is full range.347347+170M/BT.601. The Y'CbCr quantization is limited range.359348360349361350.. _col-bt2020:
···433433 int cpu1 = c->cpu_index, cpu2 = o->cpu_index;434434435435 if (c->phys_proc_id == o->phys_proc_id &&436436- per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) &&437437- c->cpu_core_id == o->cpu_core_id)438438- return topology_sane(c, o, "smt");436436+ per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2)) {437437+ if (c->cpu_core_id == o->cpu_core_id)438438+ return topology_sane(c, o, "smt");439439+440440+ if ((c->cu_id != 0xff) &&441441+ (o->cu_id != 0xff) &&442442+ (c->cu_id == o->cu_id))443443+ return topology_sane(c, o, "smt");444444+ }439445440446 } else if (c->phys_proc_id == o->phys_proc_id &&441447 c->cpu_core_id == o->cpu_core_id) {
+3-2
arch/x86/kernel/tsc.c
···13561356 (unsigned long)cpu_khz / 1000,13571357 (unsigned long)cpu_khz % 1000);1358135813591359+ /* Sanitize TSC ADJUST before cyc2ns gets initialized */13601360+ tsc_store_and_check_tsc_adjust(true);13611361+13591362 /*13601363 * Secondary CPUs do not run through tsc_init(), so set up13611364 * all the scale factors for all CPUs, assuming the same···1389138613901387 if (unsynchronized_tsc())13911388 mark_tsc_unstable("TSCs unsynchronized");13921392- else13931393- tsc_store_and_check_tsc_adjust(true);1394138913951390 check_system_tsc_reliable();13961391
+7-9
arch/x86/kernel/tsc_sync.c
···286286 if (unsynchronized_tsc())287287 return;288288289289- if (tsc_clocksource_reliable) {290290- if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)291291- pr_info(292292- "Skipped synchronization checks as TSC is reliable.\n");293293- return;294294- }295295-296289 /*297290 * Set the maximum number of test runs to298291 * 1 if the CPU does not provide the TSC_ADJUST MSR···373380 int cpus = 2;374381375382 /* Also aborts if there is no TSC. */376376- if (unsynchronized_tsc() || tsc_clocksource_reliable)383383+ if (unsynchronized_tsc())377384 return;378385379386 /*380387 * Store, verify and sanitize the TSC adjust register. If381388 * successful skip the test.389389+ *390390+ * The test is also skipped when the TSC is marked reliable. This391391+ * is true for SoCs which have no fallback clocksource. On these392392+ * SoCs the TSC is frequency synchronized, but still the TSC ADJUST393393+ * register might have been wreckaged by the BIOS..382394 */383383- if (tsc_store_and_check_tsc_adjust(false)) {395395+ if (tsc_store_and_check_tsc_adjust(false) || tsc_clocksource_reliable) {384396 atomic_inc(&skip_test);385397 return;386398 }
···100100/* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */101101#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32) adr)) % ALIGNMENT)102102103103+#ifdef __BIG_ENDIAN104104+#define xemaclite_readl ioread32be105105+#define xemaclite_writel iowrite32be106106+#else107107+#define xemaclite_readl ioread32108108+#define xemaclite_writel iowrite32109109+#endif110110+103111/**104112 * struct net_local - Our private per device data105113 * @ndev: instance of the network device···164156 u32 reg_data;165157166158 /* Enable the Tx interrupts for the first Buffer */167167- reg_data = __raw_readl(drvdata->base_addr + XEL_TSR_OFFSET);168168- __raw_writel(reg_data | XEL_TSR_XMIT_IE_MASK,169169- drvdata->base_addr + XEL_TSR_OFFSET);159159+ reg_data = xemaclite_readl(drvdata->base_addr + XEL_TSR_OFFSET);160160+ xemaclite_writel(reg_data | XEL_TSR_XMIT_IE_MASK,161161+ drvdata->base_addr + XEL_TSR_OFFSET);170162171163 /* Enable the Rx interrupts for the first buffer */172172- __raw_writel(XEL_RSR_RECV_IE_MASK, drvdata->base_addr + XEL_RSR_OFFSET);164164+ xemaclite_writel(XEL_RSR_RECV_IE_MASK, drvdata->base_addr + XEL_RSR_OFFSET);173165174166 /* Enable the Global Interrupt Enable */175175- __raw_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);167167+ xemaclite_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);176168}177169178170/**···187179 u32 reg_data;188180189181 /* Disable the Global Interrupt Enable */190190- __raw_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);182182+ xemaclite_writel(XEL_GIER_GIE_MASK, drvdata->base_addr + XEL_GIER_OFFSET);191183192184 /* Disable the Tx interrupts for the first buffer */193193- reg_data = __raw_readl(drvdata->base_addr + XEL_TSR_OFFSET);194194- __raw_writel(reg_data & (~XEL_TSR_XMIT_IE_MASK),195195- drvdata->base_addr + XEL_TSR_OFFSET);185185+ reg_data = xemaclite_readl(drvdata->base_addr + XEL_TSR_OFFSET);186186+ xemaclite_writel(reg_data & (~XEL_TSR_XMIT_IE_MASK),187187+ drvdata->base_addr + XEL_TSR_OFFSET);196188197189 /* Disable the Rx interrupts for the first buffer */198198- reg_data = __raw_readl(drvdata->base_addr + XEL_RSR_OFFSET);199199- __raw_writel(reg_data & (~XEL_RSR_RECV_IE_MASK),200200- drvdata->base_addr + XEL_RSR_OFFSET);190190+ reg_data = xemaclite_readl(drvdata->base_addr + XEL_RSR_OFFSET);191191+ xemaclite_writel(reg_data & (~XEL_RSR_RECV_IE_MASK),192192+ drvdata->base_addr + XEL_RSR_OFFSET);201193}202194203195/**···329321 byte_count = ETH_FRAME_LEN;330322331323 /* Check if the expected buffer is available */332332- reg_data = __raw_readl(addr + XEL_TSR_OFFSET);324324+ reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);333325 if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK |334326 XEL_TSR_XMIT_ACTIVE_MASK)) == 0) {335327···342334343335 addr = (void __iomem __force *)((u32 __force)addr ^344336 XEL_BUFFER_OFFSET);345345- reg_data = __raw_readl(addr + XEL_TSR_OFFSET);337337+ reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);346338347339 if ((reg_data & (XEL_TSR_XMIT_BUSY_MASK |348340 XEL_TSR_XMIT_ACTIVE_MASK)) != 0)···353345 /* Write the frame to the buffer */354346 xemaclite_aligned_write(data, (u32 __force *) addr, byte_count);355347356356- __raw_writel((byte_count & XEL_TPLR_LENGTH_MASK),357357- addr + XEL_TPLR_OFFSET);348348+ xemaclite_writel((byte_count & XEL_TPLR_LENGTH_MASK),349349+ addr + XEL_TPLR_OFFSET);358350359351 /* Update the Tx Status Register to indicate that there is a360352 * frame to send. Set the XEL_TSR_XMIT_ACTIVE_MASK flag which361353 * is used by the interrupt handler to check whether a frame362354 * has been transmitted */363363- reg_data = __raw_readl(addr + XEL_TSR_OFFSET);355355+ reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);364356 reg_data |= (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK);365365- __raw_writel(reg_data, addr + XEL_TSR_OFFSET);357357+ xemaclite_writel(reg_data, addr + XEL_TSR_OFFSET);366358367359 return 0;368360}···377369 *378370 * Return: Total number of bytes received379371 */380380-static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data)372372+static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)381373{382374 void __iomem *addr;383375 u16 length, proto_type;···387379 addr = (drvdata->base_addr + drvdata->next_rx_buf_to_use);388380389381 /* Verify which buffer has valid data */390390- reg_data = __raw_readl(addr + XEL_RSR_OFFSET);382382+ reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);391383392384 if ((reg_data & XEL_RSR_RECV_DONE_MASK) == XEL_RSR_RECV_DONE_MASK) {393385 if (drvdata->rx_ping_pong != 0)···404396 return 0; /* No data was available */405397406398 /* Verify that buffer has valid data */407407- reg_data = __raw_readl(addr + XEL_RSR_OFFSET);399399+ reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);408400 if ((reg_data & XEL_RSR_RECV_DONE_MASK) !=409401 XEL_RSR_RECV_DONE_MASK)410402 return 0; /* No data was available */411403 }412404413405 /* Get the protocol type of the ethernet frame that arrived */414414- proto_type = ((ntohl(__raw_readl(addr + XEL_HEADER_OFFSET +406406+ proto_type = ((ntohl(xemaclite_readl(addr + XEL_HEADER_OFFSET +415407 XEL_RXBUFF_OFFSET)) >> XEL_HEADER_SHIFT) &416408 XEL_RPLR_LENGTH_MASK);417409418410 /* Check if received ethernet frame is a raw ethernet frame419411 * or an IP packet or an ARP packet */420420- if (proto_type > (ETH_FRAME_LEN + ETH_FCS_LEN)) {412412+ if (proto_type > ETH_DATA_LEN) {421413422414 if (proto_type == ETH_P_IP) {423423- length = ((ntohl(__raw_readl(addr +415415+ length = ((ntohl(xemaclite_readl(addr +424416 XEL_HEADER_IP_LENGTH_OFFSET +425417 XEL_RXBUFF_OFFSET)) >>426418 XEL_HEADER_SHIFT) &427419 XEL_RPLR_LENGTH_MASK);420420+ length = min_t(u16, length, ETH_DATA_LEN);428421 length += ETH_HLEN + ETH_FCS_LEN;429422430423 } else if (proto_type == ETH_P_ARP)···438429 /* Use the length in the frame, plus the header and trailer */439430 length = proto_type + ETH_HLEN + ETH_FCS_LEN;440431432432+ if (WARN_ON(length > maxlen))433433+ length = maxlen;434434+441435 /* Read from the EmacLite device */442436 xemaclite_aligned_read((u32 __force *) (addr + XEL_RXBUFF_OFFSET),443437 data, length);444438445439 /* Acknowledge the frame */446446- reg_data = __raw_readl(addr + XEL_RSR_OFFSET);440440+ reg_data = xemaclite_readl(addr + XEL_RSR_OFFSET);447441 reg_data &= ~XEL_RSR_RECV_DONE_MASK;448448- __raw_writel(reg_data, addr + XEL_RSR_OFFSET);442442+ xemaclite_writel(reg_data, addr + XEL_RSR_OFFSET);449443450444 return length;451445}···475463476464 xemaclite_aligned_write(address_ptr, (u32 __force *) addr, ETH_ALEN);477465478478- __raw_writel(ETH_ALEN, addr + XEL_TPLR_OFFSET);466466+ xemaclite_writel(ETH_ALEN, addr + XEL_TPLR_OFFSET);479467480468 /* Update the MAC address in the EmacLite */481481- reg_data = __raw_readl(addr + XEL_TSR_OFFSET);482482- __raw_writel(reg_data | XEL_TSR_PROG_MAC_ADDR, addr + XEL_TSR_OFFSET);469469+ reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);470470+ xemaclite_writel(reg_data | XEL_TSR_PROG_MAC_ADDR, addr + XEL_TSR_OFFSET);483471484472 /* Wait for EmacLite to finish with the MAC address update */485485- while ((__raw_readl(addr + XEL_TSR_OFFSET) &473473+ while ((xemaclite_readl(addr + XEL_TSR_OFFSET) &486474 XEL_TSR_PROG_MAC_ADDR) != 0)487475 ;488476}···615603616604 skb_reserve(skb, 2);617605618618- len = xemaclite_recv_data(lp, (u8 *) skb->data);606606+ len = xemaclite_recv_data(lp, (u8 *) skb->data, len);619607620608 if (!len) {621609 dev->stats.rx_errors++;···652640 u32 tx_status;653641654642 /* Check if there is Rx Data available */655655- if ((__raw_readl(base_addr + XEL_RSR_OFFSET) &643643+ if ((xemaclite_readl(base_addr + XEL_RSR_OFFSET) &656644 XEL_RSR_RECV_DONE_MASK) ||657657- (__raw_readl(base_addr + XEL_BUFFER_OFFSET + XEL_RSR_OFFSET)645645+ (xemaclite_readl(base_addr + XEL_BUFFER_OFFSET + XEL_RSR_OFFSET)658646 & XEL_RSR_RECV_DONE_MASK))659647660648 xemaclite_rx_handler(dev);661649662650 /* Check if the Transmission for the first buffer is completed */663663- tx_status = __raw_readl(base_addr + XEL_TSR_OFFSET);651651+ tx_status = xemaclite_readl(base_addr + XEL_TSR_OFFSET);664652 if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) &&665653 (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) {666654667655 tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK;668668- __raw_writel(tx_status, base_addr + XEL_TSR_OFFSET);656656+ xemaclite_writel(tx_status, base_addr + XEL_TSR_OFFSET);669657670658 tx_complete = true;671659 }672660673661 /* Check if the Transmission for the second buffer is completed */674674- tx_status = __raw_readl(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);662662+ tx_status = xemaclite_readl(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);675663 if (((tx_status & XEL_TSR_XMIT_BUSY_MASK) == 0) &&676664 (tx_status & XEL_TSR_XMIT_ACTIVE_MASK) != 0) {677665678666 tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK;679679- __raw_writel(tx_status, base_addr + XEL_BUFFER_OFFSET +680680- XEL_TSR_OFFSET);667667+ xemaclite_writel(tx_status, base_addr + XEL_BUFFER_OFFSET +668668+ XEL_TSR_OFFSET);681669682670 tx_complete = true;683671 }···710698 /* wait for the MDIO interface to not be busy or timeout711699 after some time.712700 */713713- while (__raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &701701+ while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &714702 XEL_MDIOCTRL_MDIOSTS_MASK) {715703 if (time_before_eq(end, jiffies)) {716704 WARN_ON(1);···746734 * MDIO Address register. Set the Status bit in the MDIO Control747735 * register to start a MDIO read transaction.748736 */749749- ctrl_reg = __raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);750750- __raw_writel(XEL_MDIOADDR_OP_MASK |751751- ((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),752752- lp->base_addr + XEL_MDIOADDR_OFFSET);753753- __raw_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,754754- lp->base_addr + XEL_MDIOCTRL_OFFSET);737737+ ctrl_reg = xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);738738+ xemaclite_writel(XEL_MDIOADDR_OP_MASK |739739+ ((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),740740+ lp->base_addr + XEL_MDIOADDR_OFFSET);741741+ xemaclite_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,742742+ lp->base_addr + XEL_MDIOCTRL_OFFSET);755743756744 if (xemaclite_mdio_wait(lp))757745 return -ETIMEDOUT;758746759759- rc = __raw_readl(lp->base_addr + XEL_MDIORD_OFFSET);747747+ rc = xemaclite_readl(lp->base_addr + XEL_MDIORD_OFFSET);760748761749 dev_dbg(&lp->ndev->dev,762750 "xemaclite_mdio_read(phy_id=%i, reg=%x) == %x\n",···793781 * Data register. Finally, set the Status bit in the MDIO Control794782 * register to start a MDIO write transaction.795783 */796796- ctrl_reg = __raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);797797- __raw_writel(~XEL_MDIOADDR_OP_MASK &798798- ((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),799799- lp->base_addr + XEL_MDIOADDR_OFFSET);800800- __raw_writel(val, lp->base_addr + XEL_MDIOWR_OFFSET);801801- __raw_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,802802- lp->base_addr + XEL_MDIOCTRL_OFFSET);784784+ ctrl_reg = xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET);785785+ xemaclite_writel(~XEL_MDIOADDR_OP_MASK &786786+ ((phy_id << XEL_MDIOADDR_PHYADR_SHIFT) | reg),787787+ lp->base_addr + XEL_MDIOADDR_OFFSET);788788+ xemaclite_writel(val, lp->base_addr + XEL_MDIOWR_OFFSET);789789+ xemaclite_writel(ctrl_reg | XEL_MDIOCTRL_MDIOSTS_MASK,790790+ lp->base_addr + XEL_MDIOCTRL_OFFSET);803791804792 return 0;805793}···846834 /* Enable the MDIO bus by asserting the enable bit in MDIO Control847835 * register.848836 */849849- __raw_writel(XEL_MDIOCTRL_MDIOEN_MASK,850850- lp->base_addr + XEL_MDIOCTRL_OFFSET);837837+ xemaclite_writel(XEL_MDIOCTRL_MDIOEN_MASK,838838+ lp->base_addr + XEL_MDIOCTRL_OFFSET);851839852840 bus = mdiobus_alloc();853841 if (!bus) {···11381126 }1139112711401128 /* Clear the Tx CSR's in case this is a restart */11411141- __raw_writel(0, lp->base_addr + XEL_TSR_OFFSET);11421142- __raw_writel(0, lp->base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);11291129+ xemaclite_writel(0, lp->base_addr + XEL_TSR_OFFSET);11301130+ xemaclite_writel(0, lp->base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET);1143113111441132 /* Set the MAC address in the EmacLite device */11451133 xemaclite_update_address(lp, ndev->dev_addr);
+4-4
drivers/net/xen-netback/common.h
···113113 * A subset of struct net_device_stats that contains only the114114 * fields that are updated in netback.c for each queue.115115 */116116- unsigned int rx_bytes;117117- unsigned int rx_packets;118118- unsigned int tx_bytes;119119- unsigned int tx_packets;116116+ u64 rx_bytes;117117+ u64 rx_packets;118118+ u64 tx_bytes;119119+ u64 tx_packets;120120121121 /* Additional stats used by xenvif */122122 unsigned long rx_gso_checksum_fixup;
···16161616 /* Don't abort commands in adapter during EEH16171617 * recovery as it's not accessible/responding.16181618 */16191619- if (!ha->flags.eeh_busy) {16191619+ if (GET_CMD_SP(sp) && !ha->flags.eeh_busy) {16201620 /* Get a reference to the sp and drop the lock.16211621 * The reference ensures this sp->done() call16221622 * - and not the call in qla2xxx_eh_abort() -
+24-15
fs/btrfs/compression.c
···10241024 unsigned long buf_offset;10251025 unsigned long current_buf_start;10261026 unsigned long start_byte;10271027+ unsigned long prev_start_byte;10271028 unsigned long working_bytes = total_out - buf_start;10281029 unsigned long bytes;10291030 char *kaddr;···10721071 if (!bio->bi_iter.bi_size)10731072 return 0;10741073 bvec = bio_iter_iovec(bio, bio->bi_iter);10751075-10741074+ prev_start_byte = start_byte;10761075 start_byte = page_offset(bvec.bv_page) - disk_start;1077107610781077 /*10791079- * make sure our new page is covered by this10801080- * working buffer10781078+ * We need to make sure we're only adjusting10791079+ * our offset into compression working buffer when10801080+ * we're switching pages. Otherwise we can incorrectly10811081+ * keep copying when we were actually done.10811082 */10821082- if (total_out <= start_byte)10831083- return 1;10831083+ if (start_byte != prev_start_byte) {10841084+ /*10851085+ * make sure our new page is covered by this10861086+ * working buffer10871087+ */10881088+ if (total_out <= start_byte)10891089+ return 1;1084109010851085- /*10861086- * the next page in the biovec might not be adjacent10871087- * to the last page, but it might still be found10881088- * inside this working buffer. bump our offset pointer10891089- */10901090- if (total_out > start_byte &&10911091- current_buf_start < start_byte) {10921092- buf_offset = start_byte - buf_start;10931093- working_bytes = total_out - start_byte;10941094- current_buf_start = buf_start + buf_offset;10911091+ /*10921092+ * the next page in the biovec might not be adjacent10931093+ * to the last page, but it might still be found10941094+ * inside this working buffer. bump our offset pointer10951095+ */10961096+ if (total_out > start_byte &&10971097+ current_buf_start < start_byte) {10981098+ buf_offset = start_byte - buf_start;10991099+ working_bytes = total_out - start_byte;11001100+ current_buf_start = buf_start + buf_offset;11011101+ }10951102 }10961103 }10971104
+4-2
fs/btrfs/ioctl.c
···56535653#ifdef CONFIG_COMPAT56545654long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)56555655{56565656+ /*56575657+ * These all access 32-bit values anyway so no further56585658+ * handling is necessary.56595659+ */56565660 switch (cmd) {56575661 case FS_IOC32_GETFLAGS:56585662 cmd = FS_IOC_GETFLAGS;···56675663 case FS_IOC32_GETVERSION:56685664 cmd = FS_IOC_GETVERSION;56695665 break;56705670- default:56715671- return -ENOIOCTLCMD;56725666 }5673566756745668 return btrfs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
+5
fs/fuse/dev.c
···399399static void queue_interrupt(struct fuse_iqueue *fiq, struct fuse_req *req)400400{401401 spin_lock(&fiq->waitq.lock);402402+ if (test_bit(FR_FINISHED, &req->flags)) {403403+ spin_unlock(&fiq->waitq.lock);404404+ return;405405+ }402406 if (list_empty(&req->intr_entry)) {403407 list_add_tail(&req->intr_entry, &fiq->interrupts);404408 wake_up_locked(&fiq->waitq);···13761372 * code can Oops if the buffer persists after module unload.13771373 */13781374 bufs[page_nr].ops = &nosteal_pipe_buf_ops;13751375+ bufs[page_nr].flags = 0;13791376 ret = add_to_pipe(pipe, &bufs[page_nr++]);13801377 if (unlikely(ret < 0))13811378 break;
···123123124124#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE125125126126+/* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command127127+ * to the given target_fd cgroup the descendent cgroup will be able to128128+ * override effective bpf program that was inherited from this cgroup129129+ */130130+#define BPF_F_ALLOW_OVERRIDE (1U << 0)131131+126132#define BPF_PSEUDO_MAP_FD 1127133128134/* flags for BPF_MAP_UPDATE_ELEM command */···184178 __u32 target_fd; /* container object to attach to */185179 __u32 attach_bpf_fd; /* eBPF program to attach */186180 __u32 attach_type;181181+ __u32 attach_flags;187182 };188183} __attribute__((aligned(8)));189184
+3-4
include/uapi/linux/l2tp.h
···991010#include <linux/types.h>1111#include <linux/socket.h>1212-#ifndef __KERNEL__1313-#include <netinet/in.h>1414-#endif1212+#include <linux/in.h>1313+#include <linux/in6.h>15141615#define IPPROTO_L2TP 1151716···3031 __u32 l2tp_conn_id; /* Connection ID of tunnel */31323233 /* Pad to size of `struct sockaddr'. */3333- unsigned char __pad[sizeof(struct sockaddr) -3434+ unsigned char __pad[__SOCK_SIZE__ -3435 sizeof(__kernel_sa_family_t) -3536 sizeof(__be16) - sizeof(struct in_addr) -3637 sizeof(__u32)];
+3-4
include/uapi/linux/videodev2.h
···362362 /*363363 * The default for R'G'B' quantization is always full range, except364364 * for the BT2020 colorspace. For Y'CbCr the quantization is always365365- * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB,366366- * XV601 or XV709: those are full range.365365+ * limited range, except for COLORSPACE_JPEG, XV601 or XV709: those366366+ * are full range.367367 */368368 V4L2_QUANTIZATION_DEFAULT = 0,369369 V4L2_QUANTIZATION_FULL_RANGE = 1,···379379 (((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \380380 V4L2_QUANTIZATION_LIM_RANGE : \381381 (((is_rgb_or_hsv) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \382382- (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \383383- (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \382382+ (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \384383 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))385384386385enum v4l2_priority {
+47-12
kernel/bpf/cgroup.c
···5252 e = rcu_dereference_protected(parent->bpf.effective[type],5353 lockdep_is_held(&cgroup_mutex));5454 rcu_assign_pointer(cgrp->bpf.effective[type], e);5555+ cgrp->bpf.disallow_override[type] = parent->bpf.disallow_override[type];5556 }5657}5758···8382 *8483 * Must be called with cgroup_mutex held.8584 */8686-void __cgroup_bpf_update(struct cgroup *cgrp,8787- struct cgroup *parent,8888- struct bpf_prog *prog,8989- enum bpf_attach_type type)8585+int __cgroup_bpf_update(struct cgroup *cgrp, struct cgroup *parent,8686+ struct bpf_prog *prog, enum bpf_attach_type type,8787+ bool new_overridable)9088{9191- struct bpf_prog *old_prog, *effective;8989+ struct bpf_prog *old_prog, *effective = NULL;9290 struct cgroup_subsys_state *pos;9191+ bool overridable = true;93929494- old_prog = xchg(cgrp->bpf.prog + type, prog);9393+ if (parent) {9494+ overridable = !parent->bpf.disallow_override[type];9595+ effective = rcu_dereference_protected(parent->bpf.effective[type],9696+ lockdep_is_held(&cgroup_mutex));9797+ }95989696- effective = (!prog && parent) ?9797- rcu_dereference_protected(parent->bpf.effective[type],9898- lockdep_is_held(&cgroup_mutex)) :9999- prog;9999+ if (prog && effective && !overridable)100100+ /* if parent has non-overridable prog attached, disallow101101+ * attaching new programs to descendent cgroup102102+ */103103+ return -EPERM;104104+105105+ if (prog && effective && overridable != new_overridable)106106+ /* if parent has overridable prog attached, only107107+ * allow overridable programs in descendent cgroup108108+ */109109+ return -EPERM;110110+111111+ old_prog = cgrp->bpf.prog[type];112112+113113+ if (prog) {114114+ overridable = new_overridable;115115+ effective = prog;116116+ if (old_prog &&117117+ cgrp->bpf.disallow_override[type] == new_overridable)118118+ /* disallow attaching non-overridable on top119119+ * of existing overridable in this cgroup120120+ * and vice versa121121+ */122122+ return -EPERM;123123+ }124124+125125+ if (!prog && !old_prog)126126+ /* report error when trying to detach and nothing is attached */127127+ return -ENOENT;128128+129129+ cgrp->bpf.prog[type] = prog;100130101131 css_for_each_descendant_pre(pos, &cgrp->self) {102132 struct cgroup *desc = container_of(pos, struct cgroup, self);103133104134 /* skip the subtree if the descendant has its own program */105105- if (desc->bpf.prog[type] && desc != cgrp)135135+ if (desc->bpf.prog[type] && desc != cgrp) {106136 pos = css_rightmost_descendant(pos);107107- else137137+ } else {108138 rcu_assign_pointer(desc->bpf.effective[type],109139 effective);140140+ desc->bpf.disallow_override[type] = !overridable;141141+ }110142 }111143112144 if (prog)···149115 bpf_prog_put(old_prog);150116 static_branch_dec(&cgroup_bpf_enabled_key);151117 }118118+ return 0;152119}153120154121/**
+14-6
kernel/bpf/syscall.c
···935935936936#ifdef CONFIG_CGROUP_BPF937937938938-#define BPF_PROG_ATTACH_LAST_FIELD attach_type938938+#define BPF_PROG_ATTACH_LAST_FIELD attach_flags939939940940static int bpf_prog_attach(const union bpf_attr *attr)941941{942942+ enum bpf_prog_type ptype;942943 struct bpf_prog *prog;943944 struct cgroup *cgrp;944944- enum bpf_prog_type ptype;945945+ int ret;945946946947 if (!capable(CAP_NET_ADMIN))947948 return -EPERM;948949949950 if (CHECK_ATTR(BPF_PROG_ATTACH))951951+ return -EINVAL;952952+953953+ if (attr->attach_flags & ~BPF_F_ALLOW_OVERRIDE)950954 return -EINVAL;951955952956 switch (attr->attach_type) {···975971 return PTR_ERR(cgrp);976972 }977973978978- cgroup_bpf_update(cgrp, prog, attr->attach_type);974974+ ret = cgroup_bpf_update(cgrp, prog, attr->attach_type,975975+ attr->attach_flags & BPF_F_ALLOW_OVERRIDE);976976+ if (ret)977977+ bpf_prog_put(prog);979978 cgroup_put(cgrp);980979981981- return 0;980980+ return ret;982981}983982984983#define BPF_PROG_DETACH_LAST_FIELD attach_type···989982static int bpf_prog_detach(const union bpf_attr *attr)990983{991984 struct cgroup *cgrp;985985+ int ret;992986993987 if (!capable(CAP_NET_ADMIN))994988 return -EPERM;···1005997 if (IS_ERR(cgrp))1006998 return PTR_ERR(cgrp);100799910081008- cgroup_bpf_update(cgrp, NULL, attr->attach_type);10001000+ ret = cgroup_bpf_update(cgrp, NULL, attr->attach_type, false);10091001 cgroup_put(cgrp);10101002 break;10111003···10131005 return -EINVAL;10141006 }1015100710161016- return 0;10081008+ return ret;10171009}10181010#endif /* CONFIG_CGROUP_BPF */10191011
···34873487 int ret;34883488};3489348934903490-static int find_cpu_to_read(struct perf_event *event, int local_cpu)34903490+static int __perf_event_read_cpu(struct perf_event *event, int event_cpu)34913491{34923492- int event_cpu = event->oncpu;34933492 u16 local_pkg, event_pkg;3494349334953494 if (event->group_caps & PERF_EV_CAP_READ_ACTIVE_PKG) {34963496- event_pkg = topology_physical_package_id(event_cpu);34973497- local_pkg = topology_physical_package_id(local_cpu);34953495+ int local_cpu = smp_processor_id();34963496+34973497+ event_pkg = topology_physical_package_id(event_cpu);34983498+ local_pkg = topology_physical_package_id(local_cpu);3498349934993500 if (event_pkg == local_pkg)35003501 return local_cpu;···3625362436263625static int perf_event_read(struct perf_event *event, bool group)36273626{36283628- int ret = 0, cpu_to_read, local_cpu;36273627+ int event_cpu, ret = 0;3629362836303629 /*36313630 * If event is enabled and currently active on a CPU, update the···36383637 .ret = 0,36393638 };3640363936413641- local_cpu = get_cpu();36423642- cpu_to_read = find_cpu_to_read(event, local_cpu);36433643- put_cpu();36403640+ event_cpu = READ_ONCE(event->oncpu);36413641+ if ((unsigned)event_cpu >= nr_cpu_ids)36423642+ return 0;36433643+36443644+ preempt_disable();36453645+ event_cpu = __perf_event_read_cpu(event, event_cpu);3644364636453647 /*36463648 * Purposely ignore the smp_call_function_single() return36473649 * value.36483650 *36493649- * If event->oncpu isn't a valid CPU it means the event got36513651+ * If event_cpu isn't a valid CPU it means the event got36503652 * scheduled out and that will have updated the event count.36513653 *36523654 * Therefore, either way, we'll have an up-to-date event count36533655 * after this.36543656 */36553655- (void)smp_call_function_single(cpu_to_read, __perf_event_read, &data, 1);36573657+ (void)smp_call_function_single(event_cpu, __perf_event_read, &data, 1);36583658+ preempt_enable();36563659 ret = data.ret;36573660 } else if (event->state == PERF_EVENT_STATE_INACTIVE) {36583661 struct perf_event_context *ctx = event->ctx;
+4-8
kernel/stacktrace.c
···1818 if (WARN_ON(!trace->entries))1919 return;20202121- for (i = 0; i < trace->nr_entries; i++) {2222- printk("%*c", 1 + spaces, ' ');2323- print_ip_sym(trace->entries[i]);2424- }2121+ for (i = 0; i < trace->nr_entries; i++)2222+ printk("%*c%pS\n", 1 + spaces, ' ', (void *)trace->entries[i]);2523}2624EXPORT_SYMBOL_GPL(print_stack_trace);2725···2729 struct stack_trace *trace, int spaces)2830{2931 int i;3030- unsigned long ip;3132 int generated;3233 int total = 0;3334···3437 return 0;35383639 for (i = 0; i < trace->nr_entries; i++) {3737- ip = trace->entries[i];3838- generated = snprintf(buf, size, "%*c[<%p>] %pS\n",3939- 1 + spaces, ' ', (void *) ip, (void *) ip);4040+ generated = snprintf(buf, size, "%*c%pS\n", 1 + spaces, ' ',4141+ (void *)trace->entries[i]);40424143 total += generated;4244
+5
kernel/time/tick-sched.c
···725725 */726726 if (delta == 0) {727727 tick_nohz_restart(ts, now);728728+ /*729729+ * Make sure next tick stop doesn't get fooled by past730730+ * clock deadline731731+ */732732+ ts->next_tick = 0;728733 goto out;729734 }730735 }
+2-1
net/core/neighbour.c
···29232923 return;2924292429252925 set_bit(index, p->data_state);29262926- call_netevent_notifiers(NETEVENT_DELAY_PROBE_TIME_UPDATE, p);29262926+ if (index == NEIGH_VAR_DELAY_PROBE_TIME)29272927+ call_netevent_notifiers(NETEVENT_DELAY_PROBE_TIME_UPDATE, p);29272928 if (!dev) /* NULL dev means this is default value */29282929 neigh_copy_dflt_parms(net, p, index);29292930}
···149149 * connect() to INADDR_ANY means loopback (BSD'ism).150150 */151151152152- if (ipv6_addr_any(&usin->sin6_addr))153153- usin->sin6_addr.s6_addr[15] = 0x1;152152+ if (ipv6_addr_any(&usin->sin6_addr)) {153153+ if (ipv6_addr_v4mapped(&sk->sk_v6_rcv_saddr))154154+ ipv6_addr_set_v4mapped(htonl(INADDR_LOOPBACK),155155+ &usin->sin6_addr);156156+ else157157+ usin->sin6_addr = in6addr_loopback;158158+ }154159155160 addr_type = ipv6_addr_type(&usin->sin6_addr);156161···194189 * TCP over IPv4195190 */196191197197- if (addr_type == IPV6_ADDR_MAPPED) {192192+ if (addr_type & IPV6_ADDR_MAPPED) {198193 u32 exthdrlen = icsk->icsk_ext_hdr_len;199194 struct sockaddr_in sin;200195
+4
net/ipv6/udp.c
···10461046 if (addr_len < SIN6_LEN_RFC2133)10471047 return -EINVAL;10481048 daddr = &sin6->sin6_addr;10491049+ if (ipv6_addr_any(daddr) &&10501050+ ipv6_addr_v4mapped(&np->saddr))10511051+ ipv6_addr_set_v4mapped(htonl(INADDR_LOOPBACK),10521052+ daddr);10491053 break;10501054 case AF_INET:10511055 goto do_udp_sendmsg;
+4-2
net/kcm/kcmsock.c
···10441044 } else {10451045 /* Message not complete, save state */10461046partial_message:10471047- kcm->seq_skb = head;10481048- kcm_tx_msg(head)->last_skb = skb;10471047+ if (head) {10481048+ kcm->seq_skb = head;10491049+ kcm_tx_msg(head)->last_skb = skb;10501050+ }10491051 }1050105210511053 KCM_STATS_ADD(kcm->stats.tx_bytes, copied);
+3
net/llc/llc_conn.c
···821821 * another trick required to cope with how the PROCOM state822822 * machine works. -acme823823 */824824+ skb_orphan(skb);825825+ sock_hold(sk);824826 skb->sk = sk;827827+ skb->destructor = sock_efree;825828 }826829 if (!sock_owned_by_user(sk))827830 llc_conn_rcv(sk, skb);
···1627162716281628static int fanout_add(struct sock *sk, u16 id, u16 type_flags)16291629{16301630+ struct packet_rollover *rollover = NULL;16301631 struct packet_sock *po = pkt_sk(sk);16311632 struct packet_fanout *f, *match;16321633 u8 type = type_flags & 0xff;···16501649 return -EINVAL;16511650 }1652165116531653- if (!po->running)16541654- return -EINVAL;16521652+ mutex_lock(&fanout_mutex);1655165316541654+ err = -EINVAL;16551655+ if (!po->running)16561656+ goto out;16571657+16581658+ err = -EALREADY;16561659 if (po->fanout)16571657- return -EALREADY;16601660+ goto out;1658166116591662 if (type == PACKET_FANOUT_ROLLOVER ||16601663 (type_flags & PACKET_FANOUT_FLAG_ROLLOVER)) {16611661- po->rollover = kzalloc(sizeof(*po->rollover), GFP_KERNEL);16621662- if (!po->rollover)16631663- return -ENOMEM;16641664- atomic_long_set(&po->rollover->num, 0);16651665- atomic_long_set(&po->rollover->num_huge, 0);16661666- atomic_long_set(&po->rollover->num_failed, 0);16641664+ err = -ENOMEM;16651665+ rollover = kzalloc(sizeof(*rollover), GFP_KERNEL);16661666+ if (!rollover)16671667+ goto out;16681668+ atomic_long_set(&rollover->num, 0);16691669+ atomic_long_set(&rollover->num_huge, 0);16701670+ atomic_long_set(&rollover->num_failed, 0);16711671+ po->rollover = rollover;16671672 }1668167316691669- mutex_lock(&fanout_mutex);16701674 match = NULL;16711675 list_for_each_entry(f, &fanout_list, list) {16721676 if (f->id == id &&···17181712 }17191713 }17201714out:17211721- mutex_unlock(&fanout_mutex);17221722- if (err) {17231723- kfree(po->rollover);17151715+ if (err && rollover) {17161716+ kfree(rollover);17241717 po->rollover = NULL;17251718 }17191719+ mutex_unlock(&fanout_mutex);17261720 return err;17271721}17281722···17311725 struct packet_sock *po = pkt_sk(sk);17321726 struct packet_fanout *f;1733172717341734- f = po->fanout;17351735- if (!f)17361736- return;17371737-17381728 mutex_lock(&fanout_mutex);17391739- po->fanout = NULL;17291729+ f = po->fanout;17301730+ if (f) {17311731+ po->fanout = NULL;1740173217411741- if (atomic_dec_and_test(&f->sk_ref)) {17421742- list_del(&f->list);17431743- dev_remove_pack(&f->prot_hook);17441744- fanout_release_data(f);17451745- kfree(f);17331733+ if (atomic_dec_and_test(&f->sk_ref)) {17341734+ list_del(&f->list);17351735+ dev_remove_pack(&f->prot_hook);17361736+ fanout_release_data(f);17371737+ kfree(f);17381738+ }17391739+17401740+ if (po->rollover)17411741+ kfree_rcu(po->rollover, rcu);17461742 }17471743 mutex_unlock(&fanout_mutex);17481748-17491749- if (po->rollover)17501750- kfree_rcu(po->rollover, rcu);17511744}1752174517531746static bool packet_extra_vlan_len_allowed(const struct net_device *dev,
+1-1
samples/bpf/test_cgrp2_attach.c
···104104 return EXIT_FAILURE;105105 }106106107107- ret = bpf_prog_attach(prog_fd, cg_fd, type);107107+ ret = bpf_prog_attach(prog_fd, cg_fd, type, 0);108108 if (ret < 0) {109109 printf("Failed to attach prog to cgroup: '%s'\n",110110 strerror(errno));
+64-4
samples/bpf/test_cgrp2_attach2.c
···7979 if (join_cgroup(FOO))8080 goto err;81818282- if (bpf_prog_attach(drop_prog, foo, BPF_CGROUP_INET_EGRESS)) {8282+ if (bpf_prog_attach(drop_prog, foo, BPF_CGROUP_INET_EGRESS, 1)) {8383 log_err("Attaching prog to /foo");8484 goto err;8585 }86868787+ printf("Attached DROP prog. This ping in cgroup /foo should fail...\n");8788 assert(system(PING_CMD) != 0);88898990 /* Create cgroup /foo/bar, get fd, and join it */···9594 if (join_cgroup(BAR))9695 goto err;97969797+ printf("Attached DROP prog. This ping in cgroup /foo/bar should fail...\n");9898 assert(system(PING_CMD) != 0);9999100100- if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS)) {100100+ if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 1)) {101101 log_err("Attaching prog to /foo/bar");102102 goto err;103103 }104104105105+ printf("Attached PASS prog. This ping in cgroup /foo/bar should pass...\n");105106 assert(system(PING_CMD) == 0);106106-107107108108 if (bpf_prog_detach(bar, BPF_CGROUP_INET_EGRESS)) {109109 log_err("Detaching program from /foo/bar");110110 goto err;111111 }112112113113+ printf("Detached PASS from /foo/bar while DROP is attached to /foo.\n"114114+ "This ping in cgroup /foo/bar should fail...\n");113115 assert(system(PING_CMD) != 0);114116115115- if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS)) {117117+ if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 1)) {116118 log_err("Attaching prog to /foo/bar");117119 goto err;118120 }···125121 goto err;126122 }127123124124+ printf("Attached PASS from /foo/bar and detached DROP from /foo.\n"125125+ "This ping in cgroup /foo/bar should pass...\n");128126 assert(system(PING_CMD) == 0);127127+128128+ if (bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 1)) {129129+ log_err("Attaching prog to /foo/bar");130130+ goto err;131131+ }132132+133133+ if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 0)) {134134+ errno = 0;135135+ log_err("Unexpected success attaching prog to /foo/bar");136136+ goto err;137137+ }138138+139139+ if (bpf_prog_detach(bar, BPF_CGROUP_INET_EGRESS)) {140140+ log_err("Detaching program from /foo/bar");141141+ goto err;142142+ }143143+144144+ if (!bpf_prog_detach(foo, BPF_CGROUP_INET_EGRESS)) {145145+ errno = 0;146146+ log_err("Unexpected success in double detach from /foo");147147+ goto err;148148+ }149149+150150+ if (bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, 0)) {151151+ log_err("Attaching non-overridable prog to /foo");152152+ goto err;153153+ }154154+155155+ if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 0)) {156156+ errno = 0;157157+ log_err("Unexpected success attaching non-overridable prog to /foo/bar");158158+ goto err;159159+ }160160+161161+ if (!bpf_prog_attach(allow_prog, bar, BPF_CGROUP_INET_EGRESS, 1)) {162162+ errno = 0;163163+ log_err("Unexpected success attaching overridable prog to /foo/bar");164164+ goto err;165165+ }166166+167167+ if (!bpf_prog_attach(allow_prog, foo, BPF_CGROUP_INET_EGRESS, 1)) {168168+ errno = 0;169169+ log_err("Unexpected success attaching overridable prog to /foo");170170+ goto err;171171+ }172172+173173+ if (bpf_prog_attach(drop_prog, foo, BPF_CGROUP_INET_EGRESS, 0)) {174174+ log_err("Attaching different non-overridable prog to /foo");175175+ goto err;176176+ }129177130178 goto out;131179···188132 close(foo);189133 close(bar);190134 cleanup_cgroup_environment();135135+ if (!rc)136136+ printf("PASS\n");137137+ else138138+ printf("FAIL\n");191139 return rc;192140}
+1-1
samples/bpf/test_cgrp2_sock.c
···7575 return EXIT_FAILURE;7676 }77777878- ret = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_INET_SOCK_CREATE);7878+ ret = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_INET_SOCK_CREATE, 0);7979 if (ret < 0) {8080 printf("Failed to attach prog to cgroup: '%s'\n",8181 strerror(errno));
+1-1
samples/bpf/test_cgrp2_sock2.c
···5555 }56565757 ret = bpf_prog_attach(prog_fd[filter_id], cg_fd,5858- BPF_CGROUP_INET_SOCK_CREATE);5858+ BPF_CGROUP_INET_SOCK_CREATE, 0);5959 if (ret < 0) {6060 printf("Failed to attach prog to cgroup: '%s'\n",6161 strerror(errno));
+7
tools/include/uapi/linux/bpf.h
···123123124124#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE125125126126+/* If BPF_F_ALLOW_OVERRIDE flag is used in BPF_PROG_ATTACH command127127+ * to the given target_fd cgroup the descendent cgroup will be able to128128+ * override effective bpf program that was inherited from this cgroup129129+ */130130+#define BPF_F_ALLOW_OVERRIDE (1U << 0)131131+126132#define BPF_PSEUDO_MAP_FD 1127133128134/* flags for BPF_MAP_UPDATE_ELEM command */···184178 __u32 target_fd; /* container object to attach to */185179 __u32 attach_bpf_fd; /* eBPF program to attach */186180 __u32 attach_type;181181+ __u32 attach_flags;187182 };188183} __attribute__((aligned(8)));189184